From 5a47d0695f31a33d29306033f4f9d1b9a460bd23 Mon Sep 17 00:00:00 2001 From: Minzkraut Date: Wed, 31 May 2023 21:38:34 +0200 Subject: [PATCH] Clear guild commands on production to avoid duplicates --- events/ready.js | 1 + 1 file changed, 1 insertion(+) diff --git a/events/ready.js b/events/ready.js index dd4ffc5..2984d9a 100644 --- a/events/ready.js +++ b/events/ready.js @@ -18,6 +18,7 @@ module.exports = { console.log("Registering commands..."); if(process.env.ENV === "production") { await rest.put(Routes.applicationCommands(CLIENT_ID), {body: commands }); + await rest.put(Routes.applicationGuildCommands(CLIENT_ID, process.env.GUILD_ID), {body: [] }); //Clear Guild commands on prod console.log("Global commands registered"); } else { await rest.put(Routes.applicationGuildCommands(CLIENT_ID, process.env.GUILD_ID), {body: commands });