From 3cb54c94708b3377a358b4d03ee01b31f6b50973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 21 Aug 2021 18:29:59 +0300 Subject: [PATCH 1/4] Nulling connection after bot is disconnected --- src/client/events/voiceStateUpdate.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/events/voiceStateUpdate.js b/src/client/events/voiceStateUpdate.js index c24973f..0cccc22 100644 --- a/src/client/events/voiceStateUpdate.js +++ b/src/client/events/voiceStateUpdate.js @@ -16,6 +16,7 @@ module.exports = { if (newState.channel === null) { client.funcs.statisticsUpdate(client, newState.guild, radio); + radio.connection = null; radio.audioPlayer?.stop(); return client.radio.delete(newState.guild.id); } From 17161b72b930a8f1397e9a7f79def4cb79dc9296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 21 Aug 2021 19:12:18 +0300 Subject: [PATCH 2/4] Updated helpDescription message --- src/client/messages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/messages.js b/src/client/messages.js index 9d256f8..1e9493e 100644 --- a/src/client/messages.js +++ b/src/client/messages.js @@ -7,7 +7,7 @@ module.exports = { bugTitle: "Found a bug with %client.user.username%?", bugDescription: "Join the support server \n %client.config.supportGuild%", helpTitle: "%client.user.username% help:", - helpDescription: "%commands% \n %client.config.prefix%help to see more information about a command.", + helpDescription: "%commands%", helpCommandTitle: "%client.config.prefix%%command.name% %command.usage%", helpCommandDescription: "%command.description% \n Command Alias: %command.alias%", inviteTitle: "Invite %client.user.username% to your Discord server!", From 6afe6c30f9f8f4f72639d4d19a4d7e9bca2a69af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 21 Aug 2021 19:12:52 +0300 Subject: [PATCH 3/4] Fixed help command --- src/client/commands/help.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/commands/help.js b/src/client/commands/help.js index 593b80b..f1413fa 100644 --- a/src/client/commands/help.js +++ b/src/client/commands/help.js @@ -27,8 +27,9 @@ module.exports = { msg.channel.send({ embeds: [embed] }); } else { const categories = []; + let commandsToArray = Array.from(client.commands.values()); for (let i = 0; i < client.commands.size; i++) { - if (!categories.includes(client.commands.array()[i].category)) categories.push(client.commands.array()[i].category); + if (!categories.includes(commandsToArray[i].category)) categories.push(commandsToArray[i].category); } let commands = ''; for (let i = 0; i < categories.length; i++) { From e479e5a82a53bce2582b088ba5f547e4cd9ecb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sat, 21 Aug 2021 19:17:31 +0300 Subject: [PATCH 4/4] Updated Dependencies --- package-lock.json | 148 +++++++++++++++++++++++++++++----------------- package.json | 10 ++-- 2 files changed, 100 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8da8df9..f93276d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "eximiabots-radiox", - "version": "0.2.2", + "version": "0.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eximiabots-radiox", - "version": "0.2.2", + "version": "0.2.3", "license": "MIT", "dependencies": { - "@discordjs/opus": "^0.5.3", + "@discordjs/opus": "^0.6.0", "@discordjs/voice": "^0.6.0", "discord-api-types": "^0.22.0", "discord.js": "^13.1.0", @@ -25,12 +25,12 @@ "@typescript-eslint/parser": "^4.29.2", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^3.4.0", + "eslint-plugin-prettier": "^3.4.1", "nodemon": "^2.0.12", "prettier": "^2.3.2", "rimraf": "^3.0.2", - "ts-node": "^10.1.0", - "tsc-watch": "^4.4.0", + "ts-node": "^10.2.1", + "tsc-watch": "^4.5.0", "typescript": "^4.3.5" }, "engines": { @@ -219,13 +219,13 @@ } }, "node_modules/@discordjs/opus": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz", - "integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz", + "integrity": "sha512-Xuw8OP9BJgObEBs/SgxixnKj+y+w9st45uOAJ+cGegUGwxAIR4J7sQt3Y1J3G9SGGe82+MTxvy7sg1/QUkigcg==", "hasInstallScript": true, "dependencies": { - "@discordjs/node-pre-gyp": "^0.4.0", - "node-addon-api": "^3.2.1" + "@discordjs/node-pre-gyp": "^0.4.1", + "node-addon-api": "^4.0.0" }, "engines": { "node": ">=12.0.0" @@ -246,6 +246,53 @@ "node": ">=16.0.0" } }, + "node_modules/@discordjs/voice/node_modules/@discordjs/opus": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz", + "integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==", + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "@discordjs/node-pre-gyp": "^0.4.0", + "node-addon-api": "^3.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@discordjs/voice/node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "optional": true, + "peer": true + }, + "node_modules/@discordjs/voice/node_modules/prism-media": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", + "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", + "peerDependencies": { + "@discordjs/opus": "^0.5.0", + "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", + "node-opus": "^0.3.3", + "opusscript": "^0.0.8" + }, + "peerDependenciesMeta": { + "@discordjs/opus": { + "optional": true + }, + "ffmpeg-static": { + "optional": true + }, + "node-opus": { + "optional": true + }, + "opusscript": { + "optional": true + } + } + }, "node_modules/@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -2407,9 +2454,9 @@ "dev": true }, "node_modules/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.0.0.tgz", + "integrity": "sha512-ALmRVBFzfwldBfk3SbKfl6+PVMXiCPKZBEfsJqB/EjXAMAI+MfFrEHR+GMRBuI162DihZ1QjEZ8ieYKuRCJ8Hg==" }, "node_modules/node-cleanup": { "version": "2.1.2", @@ -2742,31 +2789,6 @@ "node": ">=6.0.0" } }, - "node_modules/prism-media": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", - "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", - "peerDependencies": { - "@discordjs/opus": "^0.5.0", - "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", - "node-opus": "^0.3.3", - "opusscript": "^0.0.8" - }, - "peerDependenciesMeta": { - "@discordjs/opus": { - "optional": true - }, - "ffmpeg-static": { - "optional": true - }, - "node-opus": { - "optional": true - }, - "opusscript": { - "optional": true - } - } - }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -3961,12 +3983,12 @@ } }, "@discordjs/opus": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz", - "integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz", + "integrity": "sha512-Xuw8OP9BJgObEBs/SgxixnKj+y+w9st45uOAJ+cGegUGwxAIR4J7sQt3Y1J3G9SGGe82+MTxvy7sg1/QUkigcg==", "requires": { - "@discordjs/node-pre-gyp": "^0.4.0", - "node-addon-api": "^3.2.1" + "@discordjs/node-pre-gyp": "^0.4.1", + "node-addon-api": "^4.0.0" } }, "@discordjs/voice": { @@ -3979,6 +4001,32 @@ "prism-media": "^1.3.1", "tiny-typed-emitter": "^2.0.3", "ws": "^7.4.4" + }, + "dependencies": { + "@discordjs/opus": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz", + "integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==", + "optional": true, + "peer": true, + "requires": { + "@discordjs/node-pre-gyp": "^0.4.0", + "node-addon-api": "^3.2.1" + } + }, + "node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "optional": true, + "peer": true + }, + "prism-media": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", + "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", + "requires": {} + } } }, "@eslint/eslintrc": { @@ -5613,9 +5661,9 @@ "dev": true }, "node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.0.0.tgz", + "integrity": "sha512-ALmRVBFzfwldBfk3SbKfl6+PVMXiCPKZBEfsJqB/EjXAMAI+MfFrEHR+GMRBuI162DihZ1QjEZ8ieYKuRCJ8Hg==" }, "node-cleanup": { "version": "2.1.2", @@ -5859,12 +5907,6 @@ "fast-diff": "^1.1.2" } }, - "prism-media": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", - "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", - "requires": {} - }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", diff --git a/package.json b/package.json index 92d50ff..0768d6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eximiabots-radiox", - "version": "0.2.2", + "version": "0.2.3", "description": "Internet Radio to your Discord guild", "main": "index.js", "scripts": { @@ -18,7 +18,7 @@ "url": "https://github.com/warengroup/eximiabots-radiox/issues" }, "dependencies": { - "@discordjs/opus": "^0.5.3", + "@discordjs/opus": "^0.6.0", "@discordjs/voice": "^0.6.0", "discord-api-types": "^0.22.0", "discord.js": "^13.1.0", @@ -34,12 +34,12 @@ "@typescript-eslint/parser": "^4.29.2", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^3.4.0", + "eslint-plugin-prettier": "^3.4.1", "nodemon": "^2.0.12", "prettier": "^2.3.2", "rimraf": "^3.0.2", - "ts-node": "^10.1.0", - "tsc-watch": "^4.4.0", + "ts-node": "^10.2.1", + "tsc-watch": "^4.5.0", "typescript": "^4.3.5" }, "engines": {