CommandOptionBuilder class

An argument for a SlashCommandBuilder.

Constructors

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})
Used to create an argument for a SlashCommandBuilder.

Properties

autoComplete bool
Set to true if option should be autocompleted
getter/setter pair
autocompleteHandler AutocompleteInteractionHandler?
getter/setter pair
channelTypes List<ChannelType>?
If type is channel then list can be used to restrict types of channel to choose from
getter/setter pair
choices List<ArgChoiceBuilder>?
Choices for CommandOptionType.string and CommandOptionType.string types for the user to pick from
getter/setter pair
defaultArg bool
If this should be the fist required option the user picks
getter/setter pair
description String
The description of your argument / sub-group.
final
handler SlashCommandHandler?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
name String
The name of your argument / sub-group.
final
options List<CommandOptionBuilder>?
If the option is a subcommand or subcommand group type, this nested options will be the parameters
getter/setter pair
required bool
If this argument is required
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type CommandOptionType
The type of arg that will be later changed to an INT value, their values can be seen in the table below:
final

Methods

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

Operators

operator ==(Object other) bool
The equality operator.
inherited