Reputation: 64
How do I delete a specific guild/global slash command?
I tried searching on google how, but I'm just confused about the command id thingy.
Upvotes: 2
Views: 4453
Reputation: 9041
You can use ApplicationCommand.delete()
.
This will delete a global command by name:
client.application.commands.cache.find(c => c.name === 'cmd_name_here').delete()
//make sure that client is an instance of Client
And this will delete a guild command by name:
guild.commands.cache.find(c => c.name === 'cmd_name_here').delete()
//make sure that guild is an instance of Guild
This only works on v13 however. On v12 you need to make an API request
Upvotes: 1