SlashOption
Sets a parameter as a slash command option from Discord.
The supported data types can be seen in SlashParameterResolver, more types can be supported by implementing it.
Display name
Option names can be inferred from the parameter's name, see the wiki for more details.
Order
Options have the same order on Discord and the method, however, required options must be placed first (i.e., not null, and without a default value).
If the options are unordered, they will be automatically ordered and logged.
Modifiers
@LongRange/@DoubleRange: Changes the allowed value range
@Length: Changes the allowed string length
@ChannelTypes: Changes the allowed channel types, see the
GuildChannelsupport on SlashParameterResolverAny
@Nullableannotation: Makes the parameter optional
Choices
Choices can be added by either their parameter resolver, or by the application command itself from implementing SlashOptionChoiceProvider.
Varargs
You can set this parameter to be a vararg using @VarArgs, multiple varargs are allowed.
See also
Properties
Name of the autocomplete handler.
Description of the option.
Must follow the Discord specifications, see the OptionData constructor for details.
Name of the option.
Must follow the Discord specifications, see the OptionData constructor for details.
Enables using choices from SlashParameterResolver.getPredefinedChoices.