commands not refreshing
I have always added my commands on the ready function, but I read somewhere that this is not a good practice, anyone has any materials to read on that?
recently my bot has been pretty slow to add or update commands changed, I wonder if I cross some sort of threshold that makes it slower or something like that.
3 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 commands only need to be registered once, and updated when the definition (description, options etc) is changed. As there is a daily limit on command creations, it's not necessary nor desirable to connect a whole client to the gateway or do this on every ready event. As such, a standalone script using the lighter REST manager is preferred.https://discordjs.guide/creating-your-bot/command-deployment.html#command-registration
So, this rest command only updates one guild right, so I should runt that in a loop for all guilds that my bot is in?
I have a command that has been added for days and have not shown in some clients yet
never mind, read the whole thing and it explains there