CommandOptionBuilder class

An argument for a SlashCommandBuilder.

Inheritance

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, num? min, num? max, Map<Locale, String>? localizationsName, Map<Locale, String>? localizationsDescription})
Used to create an argument for a SlashCommandBuilder.

Properties

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, CommandOptionType.integer and CommandOptionType.number types for the user to pick from
read / write
defaultArg bool
If this should be the first required option the user picks
read / write
description String
The description of your argument / sub-group.
final
handler SlashCommandHandler?
read / write
hashCode int
The hash code for this object.
read-onlyinherited
localizationsDescription Map<Locale, String>?
The localizations description of your argument / sub-group. See SlashCommandBuilder.localizationsDescription for more information.
final
localizationsName Map<Locale, String>?
The localizations name of your argument / sub-group. See SlashCommandBuilder.localizationsName for more information.
final
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.
final
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-onlyinherited
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
override
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