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 User2y ago
Message Not Public
Sign In & Join Server To View
Jaworek
Jaworek2y 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 docs2y 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
Erin2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server
More Posts
Expecting a string primitive for SlashCommandBuilderI tried making an embed command using Slash commands and a lot of paramaters(probably not a good idewhen his bot is inside a voice channel, moving others takes about 5 seconds, whilst when it’s not inthere is a very strange bug when my bot is in vocal and that it has to move a member the action but How can I get the voice states of members?How can I get the voice states of members? For some reason do I only get the voice states of the memAdding a role to owner of a server.Hello, I've searched the Internet for this answer but did not find it, so here I am. I wanted to knHow to see which option was triggered from an interactionI have a slash command where there are two options (say a and b). a has three choices say 1,2,3 b haSending files from vue front end to custom discord bot through express backend.I'm wondering what the best process to doing this is. Currently I have a vue frontend component whicIs it possible for a bot so send a message before it goes offline?I am just wondering, can I make it so my bot sends a "Going Offline" message right before it becomesMismatched parameters and command handler not to optimized.Hi devs, im triying to fix my mismatched parameters and maybe the handler its the problem!How do I get target messageHow do I check if message is a reply and get the target message?Implementing slash commands with options - choicesI am trying to add options to my existing slash command code but on testing discord does not show me