Registering
Learn how to register your application commands properly
First, we need to take a look at different types of application commands:
Global: can be used globally, on every guilds
Guild: can only be used in a specific guild
User: can only be used by a specific user
These are specific scopes that an application command can be applied to.
Global commands
To register a global command you'll need to use the following Client method: registerGlobalApplicationCommand
and pass your Application Command inside it.
Here's an example:
To register multiple global commands, you can use the bulkRegisterGlobalApplicationCommand
method.
Guild commands
It is pretty much the same as Global commands but you have to pass the Guild ID inside the registerGuildApplicationCommand
method.
to register more than one guild command, you can use the alternative method: bulkRegisterGlobalApplicationCommand
, though you will have to specify the guild ID inside each object instead:
User commands
It is pretty much the same as registering guild command(s), use the Client methdo called registerGuildApplicationCommand
:
and for bulk registering use bulkRegisterUserApplicationCommand
and specify the User ID for each command:
Learn more on how to detect when Application Commands are executed.
Last updated