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
d.js toolkit
d.js toolkit10mo ago
- 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 OP
duck
duck10mo ago
Slash 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
Sharp
SharpOP10mo ago
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
Want results from more Discord servers?
Add your server