From 00cba5db51bb4e93f5cf40ec96a787426c1e03fe Mon Sep 17 00:00:00 2001 From: JiPaix <26584973+JiPaix@users.noreply.github.com> Date: Tue, 11 Apr 2023 01:30:03 +0200 Subject: [PATCH] release 5.0.0 --- CHANGELOG.md | 12 ++++++++++++ README.md | 35 ++++++++++++++++++++++++++++------- package.json | 2 +- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa01ee..d3cf694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,16 @@ # Changelog +## [v5.0.0](https://github.com/jipaix/xdccjs/tree/v5.0.0) +### BREAKING CHANGES +* `xdcc.irc` is no longer needed and accessible, methods and event are directly embed into `xdcc` +### fix(lib+cli) +* throttle doesn't affect bandwidth +* change units (KiB, MiB, GiB, etc..) +## feat(lib) +* add `xdcc.config()` - change/access parameters during runtime +* access irc-framework methods and events `xdcc.irc.join('#lol')` -> `xdcc.join('#lol')` +### refactor(lib) +* check user's parameters beforehand +--- ## [v4.7.0](https://github.com/jipaix/xdccjs/tree/v4.7.0) ### feat(lib+cli) * add option to throttle bandwidth diff --git a/README.md b/README.md index 41092ef..7b7bba2 100644 --- a/README.md +++ b/README.md @@ -77,11 +77,11 @@ const opts = { tls: { enable: true, // Enable TLS Support - default: false rejectUnauthorized: true, // Reject self-signed certificates - default: false - }, + }, nickname: 'ItsMeJiPaix', // Nickname - default: xdccJS + random + nickServ: 'complex_password', // Your NickServ password (no spaces) - default: undefined (disabled) chan: ['#candy', '#fruits'], // Array of channels - default : [ ] (no chan) path: 'downloads', // Download path or 'false' - default: false (which enables piping) - nickServ: 'complex_password', // Your NickServ password (no spaces) - default: undefined (disabled) retry: 2, // Nb of retries before skip - default: 1 timeout: 50, // Nb of seconds before a download is considered timed out - default: 30 verbose: true, // Display download progress and jobs status - default: false @@ -93,6 +93,29 @@ const opts = { // ^ Regex matching the bot's message when you're request is moved to a queue } ``` + + +### Config +>xdccJS.**config( parameters?** : object **)** +change parameters during runtime +If there's a file downloading `throttle` and `passivePort` won't be applied until the next download +```js +xdccJS.config({ + passivePort: [5000, 5001, 5002], + throttle: 800, + nickname: 'TrustMe', + chan: ['#candy', '#fruits'], + path: 'download/subfolder', + botNameMatch: false, + retry: 5, + timeout: 50, + verbose: false, + randomizeNick: true, + queue: /soMething(.*)maTching/g +}) +``` + + ### Download >xdccJS.**download( bot** : string, **packets** : string | number | number[] | string[], **ipv6?**: boolean **)** `download()` is asynchronous and returns a `Job` @@ -309,17 +332,15 @@ xdccJS.on('can-quit', () => { }) ``` ## Advanced IRC commands -**xdccJS uses [@kiwiirc/irc-framework](https://github.com/kiwiirc/irc-framework)** client which is **entirely** accessible via the `irc` property. +**[@kiwiirc/irc-framework](https://github.com/kiwiirc/irc-framework) is embed into xdccJS**. Check their client API [documentation](https://github.com/kiwiirc/irc-framework/blob/master/docs/clientapi.md) ```js -// middlewares -xdccJS.irc.use(middleware) xdccJS.on('ready', () => { // change nickname - xdccJS.irc.changeNick('new-nickname') + xdccJS.changeNick('new-nickname') // listen to kick events - xdccJS.irc.on('kick', (info) => { + xdccJS.on('kick', (info) => { //=> do something.. }) }) diff --git a/package.json b/package.json index 29e0d2f..e10e7cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xdccjs", - "version": "4.7.0", + "version": "5.0.0", "description": "download files from XDCC bots on IRC, complete implementation of the XDCC protocol", "engines": { "node": ">=14.0.0"