CommandOptionBuilder class Null safety

An argument for a SlashCommandBuilder.



CommandOptionBuilder(CommandOptionType type, String name, String description, {bool defaultArg = false, bool required = false, List<ArgChoiceBuilder>? choices, List<CommandOptionBuilder>? options, List<ChannelType>? channelTypes, bool autoComplete = false, num? min, num? max})
Used to create an argument for a SlashCommandBuilder.


autoComplete bool
Set to true if option should be autocompleted
read / write
autocompleteHandler AutocompleteInteractionHandler?
read / write
channelTypes List<ChannelType>?
If type is channel then list can be used to restrict types of channel to choose from
read / write
choices List<ArgChoiceBuilder>?
Choices for CommandOptionType.string and CommandOptionType.string types for the user to pick from
read / write
defaultArg bool
If this should be the fist required option the user picks
read / write
description String
The description of your argument / sub-group.
handler SlashCommandHandler?
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
max num?
If this is a number option (CommandOptionType.integer or CommandOptionType.number), the minimum value the user can input.
read / write
min num?
If this is a number option (CommandOptionType.integer or CommandOptionType.number), the minimum value the user can input.
read / write
name String
The name of your argument / sub-group.
options List<CommandOptionBuilder>?
If the option is a subcommand or subcommand group type, this nested options will be the parameters
read / write
required bool
If this argument is required
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
type CommandOptionType
The type of arg that will be later changed to an INT value, their values can be seen in the table below: | Name | Value | |-------------------|-------| | SUB_COMMAND | 1 | | SUB_COMMAND_GROUP | 2 | | STRING | 3 | | INTEGER | 4 | | BOOLEAN | 5 | | USER | 6 | | CHANNEL | 7 | | ROLE | 8 |


build() RawApiMap
Returns built response for api
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
registerAutocompleteHandler(AutocompleteInteractionHandler handler) → void
registerHandler(SlashCommandHandler handler) → void
Registers handler for subcommand
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]