How can I make sure slash commands are only added/registered once?
I was adding and removing my bot from my server once for testing purposes and recently ran into the "Interaction already acknowledged" error.
I fixed it by once again re-adding my bot, but how can I prevent slash commands from being added if they already exist or just prevent this in general?
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!
- ✅
Marked as resolved by OPslash command will only be registered once
That error is because you replied twice to the same interaction
It was not. The literal fix was removing the bot from the server and re-adding it.
I made sure the bot was only replying to the interaction once.
There is only one running docker container
slash commands cannot be registered twice
Sure you can have duplicated commands, but thats when you have both guild and global commands
So, maybe my code for setting specific guild commands and free commands were off, thanks.
That's all I wanted to know.