Sync Slash Commands with one Guild
Hello, I have a test server which i use to test my bots, I am new to sapphire, and by reading the docs, I couldn't find a way to make the app sync the commands to a single guild/server. I do not want to sync with all servers as I noticed that is slow and takes a few minutes, whereas when i sync with one server (my server) it's almost immediate. Can you do that in sapphire? Please help
5 Replies
You can specify an array of guildIds in the command registry
So i have to do it for every command? Is there a way to apply it globally
@b1nzee
There isn't but you can just define a constant somewhere and import that in your commands. Or alternatively you can leverage class extension and supplement it that way. Never forget you got all the power of modules, object oriented programming and class inheritance available still.
Would solve the problem of changing guildCommands for prod & dev environment. (if you use two different ones)
(not sure if i read that requirement from your message correctly)
nvm it was not
This is how I tackle that for @Dragonite. Like I keep saying to so many people, never forget you have modules and you can split your code across files.
DragoniteCommand
exists for the sole purpose of assigning default required permissions to all commands.