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, 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
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, CommandOptionType.integer and CommandOptionType.number types for the user to pick from
getter/setter pair
- defaultArg ↔ bool
-
If this should be the first 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
-
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.
getter/setter pair
- min ↔ num?
-
If this is a number option (CommandOptionType.integer or CommandOptionType.number), the minimum value the user can input.
getter/setter pair
- 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