I have this delete-commands.js for slash commands and it isn't working.

https://gist.github.com/DudeThatsErin/b0231f2a38cb85309a33de14faac0107 This is the error message I receive: https://gist.github.com/DudeThatsErin/dbfdba65ae363a280427d629b46c4bed https://i.imgur.com/tEO7dxl.png Not sure why. This bot is in 2 servers.. my test server and its main server. It seems to run fine as the last message.reply sends but then it displays the error. Not sure why this is happening.
Gist
codinghelp
codinghelp. GitHub Gist: instantly share code, notes, and snippets.
Gist
error message
error message. GitHub Gist: instantly share code, notes, and snippets.
Imgur
5 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Jaworek
Jaworek3y ago
u need specific command to delete or set commands to [] just like example in this tag dont looks at topic
d.js docs
d.js docs3y ago
If you have duplicate commands on your server, you registered both global and guild commands. You can remove the duplicates by resetting either the global or guild commands • Resetting global commands: rest.put(Routes.applicationCommands(clientId), { body: [] }) • Resetting guild commands: rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
Erin
ErinOP3y ago
I do that. I have this body: message.client.slashCommands which is my array of all of my slash commands for the main server and then body: message.client.erinCommands which is the array for all of my slash commands in my test server. Tried that anyway...
await rest.delete(
Routes.applicationGuildCommands(bot.id, bot.serverId),
{ body: [] },
);

message.reply('deleted client.slashCommands')

await rest.delete(
Routes.applicationGuildCommands(bot.id, bot.testServerId),
{ body: [] },
);

message.reply('deleted client.erinCommands');
await rest.delete(
Routes.applicationGuildCommands(bot.id, bot.serverId),
{ body: [] },
);

message.reply('deleted client.slashCommands')

await rest.delete(
Routes.applicationGuildCommands(bot.id, bot.testServerId),
{ body: [] },
);

message.reply('deleted client.erinCommands');
still got 405: Method not allowed
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server