From 5800bdd5553505c59c4a91d60d8bebb5d0991377 Mon Sep 17 00:00:00 2001 From: Legonzaur Date: Fri, 16 Jun 2023 23:17:21 +0200 Subject: [PATCH] fix slash command double --- src/syncCommands.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/syncCommands.ts b/src/syncCommands.ts index 32c7a05..655941d 100644 --- a/src/syncCommands.ts +++ b/src/syncCommands.ts @@ -12,7 +12,8 @@ const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(' const promises = [] as Array> for (const file of commandFiles) { const filePath = path.join(commandsPath, file) - promises.push(import(filePath).then(({ default: command }) => { + promises.push(import(filePath).then(({ default: command, global }) => { + if (global === true) return if ('data' in command && 'execute' in command) { commands.push(command.data.toJSON()) } else {