#How to publish guild specific commands while having global commands
49 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
do separate rest requests
rest.put(Routes.applicationCommands(clientId), { body })
and rest.put(Routes.applicationGuildCommands(clientId, guildId), { body })
pass the commands you want for each in the body
i dont think i am using rest for my implementation
the tutorial i started showed me like this
well don't follow that
use discordjs.guide
it's maintained by discord.js developers and the community, and kept updated
you are using client.application which requires the bot to be logged in
this is not good practice
ohh
so on reading that guide i had few doubt
once i create my deploy-commands.js
how do i make it run automatically when my bot is added to a new server
what why
let me rephrase
which requires the bot to be logged in
this also usually comes with setting in ready event
what if the bot joins a server after that was run
you only need to deploy when commands are updated
then they have the global commands
why
just use rest
doesn't even need the client logged in
here it says change applicationGuildCommands to applicationCommands but i still need to run it myself right
so will the new server automatically get it ?
yes the new server will get the global commands
👍
i need to import my set of commands into this. how can i make it take the details from each file and auto create the set of commands. edit: done. found a method
Creating Your Bot: Registering commands - Command deployment script