CommandArg class Null safety
An argument for a SlashCommand.
Constructors
-
CommandArg(CommandArgType type, String name, String description, {bool defaultArg = false, bool required = false, List<
ArgChoice> ? choices, List<CommandArg> ? options}) - Used to create an argument for a SlashCommand. Tease are used in Interactions.registerCommand
Properties
-
choices
↔ List<
ArgChoice> ? -
Choices for CommandArgType.string and CommandArgType.string types for the user to pick from
read / write, final, late
- defaultArg ↔ bool
-
If this should be the fist required option the user picks
read / write, final, late
- description ↔ String
-
The description of your argument / sub-group.
read / write, final, late
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- name ↔ String
-
The name of your argument / sub-group.
read / write, final, late
-
options
↔ List<
CommandArg> ? -
If the option is a subcommand or subcommand group type, this nested options will be the parameters
read / write, final, late
- required ↔ bool
-
If this argument is required
read / write, final, late
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- type ↔ CommandArgType
-
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 |
read / write, final, late
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited