Slash command setting not working
Trying to set slash commands for my bot and I'm not getting any errors, but my slash commands are not being updated properly. I'm using DJS 14.14.1. Am I doing something wrong?
12 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!Registering commands on ready isn’t recommended. You only need to deploy commands if you change their signature
I tried this before too, but I didn't get it work
And is the client ID my bot's application ID?
Yep
One second. Let me change my code back to register before.
Also, thanks for the help! :)
Global commands should be available in dms be default
Should it register in guilds/dms right away? Or do I have to wait a certain time?
That's the new code. I removed the permissions as well. Should I keep it in?
It hasn't updated though: https://fyi.cx/MYPqGbG.png
What I was using to previously register commands worked, but when I updated to 14.14.1, it busted
(that screenshot is in a server btw, not DMs)
And I clicked off and back on
Ahh.
In a last-ditch effort, I just CTRL+R to refresh discord and I see the updated commands. I have to refresh every time to see the updates? I guess I'm just stupid then lmao
Yeah sometimes you need to refresh the client to reload commands. The portion that registers commands should be in a separate file so you’re not hitting the command endpoint every time you start the bot, you’re likely to hit a rate limit while testing.