delete all commands
I'm trying to get a command, but the commands keep returning 0.
Maybe I missed something?
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPWhat are you trying to achieve with your code
What I'm trying to do now is delete all guild commands once the bot is ready.
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: [] })
Just use the second method, you don't need to fetch or do them one by one
You shouldn't be doing this every time your bot starts, either
I already try that one but nothing happen
I will try again now
it's work with Global Command
oh
problem was being registered with Global Command.