Skip to content

Commit

Permalink
Added a way to clear the old application commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maseshi committed May 16, 2022
1 parent 59defea commit dd2fee2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/events/client/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,19 @@ module.exports = async (client) => {
const data = client.interaction.map(commands => commands.interaction.data);

if (client.mode === "start") {
// Remove all old commands.
await client.application.commands.set([]);

// Set all new commands.
await client.application.commands.set(data);

spinnies.remove("app-commands-loading");
console.log("Application (/) commands is ready to use. ");
} else {
// Remove all old commands.
await client.application.commands.set([]);

// Set all new commands.
await client.application.commands.set(data, guildID);

spinnies.remove("app-commands-loading");
Expand Down

0 comments on commit dd2fee2

Please sign in to comment.