SlashOption

annotation class SlashOption(val name: String = "", val description: String = "", val usePredefinedChoices: Boolean = false, val autocomplete: String = "")(source)

Sets a parameter as a slash command option from Discord.

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.

Choices

Choices can be added by either their parameter resolver, or the application command itself.

See also

@Optional

@Nullable

@Aggregate

@LongRange

@DoubleRange

@Length

@ChannelTypes

@AutocompleteHandler

@VarArgs

SlashCommandBuilder.option

DSL equivalent

Properties

Link copied to clipboard

Name of the autocomplete handler.

Link copied to clipboard

Description of the option.
Must follow the Discord specifications, see the OptionData constructor for details.

Link copied to clipboard

Name of the option.
Must follow the Discord specifications, see the OptionData constructor for details.

Link copied to clipboard