JDASlash Command
Declares this function as a slash command, additional properties can be set with @TopLevelSlashCommandData and @SlashCommandGroupData.
See the Discord docs on which paths are allowed.
Additional annotations
Additional data can be set once per subcommand group with @SlashCommandGroupData.
Requirements
The declaring class must be annotated with @Command and extend ApplicationCommand.
First parameter must be GlobalSlashEvent for global commands, or, GuildSlashEvent for global guild-only and guild commands.
If you have subcommands, @TopLevelSlashCommandData must be used once per top-level name, e.g., if you have
/tag create
and/tag edit
, you can annotate at most one of them.
Option types
Input options: Uses @SlashOption, supported types and modifiers are in ParameterResolver, additional types can be added by implementing SlashParameterResolver.
Custom options: No annotation, additional types can be added by implementing ICustomResolver.
Service options: No annotation, however, I recommend injecting the service in the class instead.
See also
@Command
@TopLevelSlashCommandData
@SlashCommandGroupData
@SlashOption
@UserPermissions
@BotPermissions
@Cooldown
@RateLimit
@Filter
Declaring global application commands using the DSL
Declaring guild application commands using the DSL
DSL equivalent