From e5f893284bdca8b58c9f96b80889d4b197709847 Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com> Date: Fri, 30 Jul 2021 14:07:57 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=93=84=20add=20LICENSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..74333ef --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Tristan Guichaoua + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 000767e25d9499a7c919e849a13baa1b2fe51c89 Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Fri, 30 Jul 2021 17:16:32 +0200 Subject: [PATCH 2/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20discord.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 903ccf7..2cafb72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -796,9 +796,9 @@ "dev": true }, "discord.js": { - "version": "13.0.0-dev.4f1f32f.1627517033", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.4f1f32f.1627517033.tgz", - "integrity": "sha512-gjsE4ENDf1OItxFqaB8YjZMc8pP5TpTMntwE9jOSlw8BXxsqxpb8+U8xfg+0Ew69p1y7TlAlfLmM85r4+lGKww==", + "version": "13.0.0-dev.2675b08.1627646567", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.0.0-dev.2675b08.1627646567.tgz", + "integrity": "sha512-om6QhCwYwaW04Px5LZR9mRD7PEY/wPYrpGhMJFUFwPo8KwLKN2o66CGPb8PZ0uY1XZquEvUjFzVjzBZ//3WRPA==", "dev": true, "requires": { "@discordjs/builders": "^0.2.0", diff --git a/package.json b/package.json index 7de5420..52651b2 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@typescript-eslint/eslint-plugin": "^4.28.4", "@typescript-eslint/parser": "^4.28.4", "chai": "^4.3.4", - "discord.js": "^13.0.0-dev.4f1f32f.1627517033", + "discord.js": "^13.0.0-dev.2675b08.1627646567", "eslint": "^7.31.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^3.4.0", From d7cd11a6380ce8126c9231fe8913017903be8034 Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Fri, 30 Jul 2021 17:16:55 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=91=BD=EF=B8=8F=20discord.js=20api=20?= =?UTF-8?q?change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/command/GroupSlashCommand.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command/GroupSlashCommand.ts b/src/command/GroupSlashCommand.ts index f3ed49c..f201005 100644 --- a/src/command/GroupSlashCommand.ts +++ b/src/command/GroupSlashCommand.ts @@ -22,8 +22,8 @@ export class GroupSlashCommand extends SlashCommand { /** @internal */ async execute(interaction: CommandInteraction): Promise { - const subCommandName = interaction.options.getSubCommand(); - const groupName = interaction.options.getSubCommandGroup(false); + const subCommandName = interaction.options.getSubcommand(); + const groupName = interaction.options.getSubcommandGroup(false); const executable = groupName !== null From b669d515dd021390f6d52c520451ef24ba4339de Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Fri, 30 Jul 2021 17:17:38 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=94=A7=20fix=20peer=20dependencies=20?= =?UTF-8?q?version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52651b2..69246ef 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "typescript": "^4.3.5" }, "peerDependencies": { - "discord.js": "13.x" + "discord.js": "^13.0.0-dev" }, "engines": { "node": ">=14.0.0" From d0061fd48e340657bbdc50159a2c2ef030d4f48c Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Fri, 30 Jul 2021 17:18:49 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20rename=20'handler'=20-?= =?UTF-8?q?>=20'command'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SlashCommandManager.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SlashCommandManager.ts b/src/SlashCommandManager.ts index dc0a66a..bf823f8 100644 --- a/src/SlashCommandManager.ts +++ b/src/SlashCommandManager.ts @@ -15,8 +15,8 @@ export class SlashCommandManager { } async execute(interaction: CommandInteraction): Promise { - const handler = this.commands.get(interaction.commandName); - if (handler) handler.execute(interaction); + const command = this.commands.get(interaction.commandName); + if (command) command.execute(interaction); } static create(options?: SlashCommandManagerOptions): SlashCommandManager { @@ -56,10 +56,10 @@ export class SlashCommandManager { } }; - const commandHandlers = new Map(); + const commands = new Map(); for (const l1 of fs.readdirSync(commandFolder, { withFileTypes: true })) { - if (l1.isFile()) loadFile(commandFolder, l1.name, commandHandlers); + if (l1.isFile()) loadFile(commandFolder, l1.name, commands); else if (l1.isDirectory()) { const folder1 = path.join(commandFolder, l1.name); @@ -95,14 +95,14 @@ export class SlashCommandManager { } } - commandHandlers.set( + commands.set( l1.name, new GroupSlashCommand(l1.name, description, defaultPermission, subCommands, groups), ); } } - return new SlashCommandManager(commandHandlers); + return new SlashCommandManager(commands); } } From 9a64624c6d4530b1ff9b1c684e873dc03340c15b Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Fri, 30 Jul 2021 17:19:26 +0200 Subject: [PATCH 6/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20@types/node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2cafb72..1ef4952 100644 --- a/package-lock.json +++ b/package-lock.json @@ -207,9 +207,9 @@ "dev": true }, "@types/node": { - "version": "16.4.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.6.tgz", - "integrity": "sha512-FKyawK3o5KL16AwbeFajen8G4K3mmqUrQsehn5wNKs8IzlKHE8TfnSmILXVMVziAEcnB23u1RCFU1NT6hSyr7Q==", + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.7.tgz", + "integrity": "sha512-aDDY54sst8sx47CWT6QQqIZp45yURq4dic0+HCYfYNcY5Ejlb/CLmFnRLfy3wQuYafOeh3lB/DAKaqRKBtcZmA==", "dev": true }, "@types/parse-json": { diff --git a/package.json b/package.json index 69246ef..19c915c 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "devDependencies": { "@types/chai": "^4.2.21", "@types/mocha": "^9.0.0", - "@types/node": "^16.4.2", + "@types/node": "^16.4.7", "@typescript-eslint/eslint-plugin": "^4.28.4", "@typescript-eslint/parser": "^4.28.4", "chai": "^4.3.4",