how do djs and other wrappers sync application commands
yo guys i have another api question
how do djs and other wrappers sync application commands
im sending post requests to create commands, but i have to send the requests each time i run my bot for some reason
if i don't, the commands no longer show up
11 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!it doesn't
you're probably running
ApplicationCommandManager#set([])
somewhere
that's why the guide includes the deploy script, so you deploy commands manuallyyea but how does that work
when i sync commands i dont have to refresh my discord app whenever i re run the bot
but when i manually add commands i have to refresh it, since the commands added during the previous instance of my app no longer work
well, that erases all your commands
oh
if you then call set once again but with your commands, then that'll set them again
which is kind of redundant
so by default if i create a command it doesnt get deleted?
if i re run my bot
well #set is simply an api call, it's discord who manages whatever happens
yea so rn what im tryna do is
manually make the api call myself
and still retain the commands even if i re run the bot
just don't set an empty array
or even better only deploy when it's actually needed
eg when you change your command's data
alr cool thanks