Duplicated commands (not global)
im starting out with a very basic command ping-pong! when i use deploy-command.ts script multiple times, i see the command twice on my server. I don't get why this is happening. Ive followed the guide step by step :
https://discordjs.guide/creating-your-bot/slash-commands.html#before-you-continue
I can share my code if needed .
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
5 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!fyi, when i kick the bot from the server and readd it, the command appears once !
this is my deploy-commands.ts
are you sure you didn't deploy globally first?
the guide first covers how to deploy globally, then per guild
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: [] })
Ah thanks
Gonna check that out