How to publish guild specific commands while having global commands
I have two folders for two categories of commands. One folder named "commands" for global commands and one folder named "guildCommands" for commands that is for only some guilds.
37 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
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
why 🤔
you should
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
ok
could you let me know what i am using rn
over here
await client.application.commands.set(client.commands);
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
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
which requires the bot to be logged inthis also usually comes with setting in ready event
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
no
that's terrible
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
setting in ready event is not needed
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
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
why
just use rest
doesn't even need the client logged in
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
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
ok
thanks
will try and update
👍
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