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
d.js toolkit
d.js toolkit2mo 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!
Amgelo
Amgelo2mo ago
it doesn't you're probably running ApplicationCommandManager#set([]) somewhere that's why the guide includes the deploy script, so you deploy commands manually
kishore
kishore2mo ago
yea 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
Amgelo
Amgelo2mo ago
well, that erases all your commands
kishore
kishore2mo ago
oh
Amgelo
Amgelo2mo ago
if you then call set once again but with your commands, then that'll set them again which is kind of redundant
kishore
kishore2mo ago
so by default if i create a command it doesnt get deleted? if i re run my bot
Amgelo
Amgelo2mo ago
well #set is simply an api call, it's discord who manages whatever happens
kishore
kishore2mo ago
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
Amgelo
Amgelo2mo ago
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
kishore
kishore2mo ago
alr cool thanks
Want results from more Discord servers?
Add your server