From 1b8e8fd8fbec0fb97b1d46bc4a25a226064cf69f Mon Sep 17 00:00:00 2001 From: Charlie Laabs Date: Sat, 1 Jan 2022 23:20:22 -0600 Subject: [PATCH] A fix to remove the duplicate commands --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index 4682da0..256cd8c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -492,6 +492,11 @@ client.on('ready', async (readyClient) => { await deployCommands(readyClient.user.id); const guildsToSave = readyClient.guilds.valueOf().map((guild) => Guild.create({ id: guild.id })); + + // Remove the duplicate commands + if (!config.devGuildId) { + await Promise.all(readyClient.guilds.valueOf().map(async (guild) => guild.commands.set([]))); + } await Guild.upsert(guildsToSave, ['id']); });