NumConverter<T extends num> class
A converter that converts input to various types of numbers, possibly with a minimum or maximum value.
Note: this converter does not ensure that all values will be in the range min..max
. min and
max offer purely client-side validation and input from text commands is not validated beyond
being a valid number.
You might also be interested in:
- IntConverter, for converting ints;
- DoubleConverter, for converting doubles.
- Inheritance
- Implementers
Constructors
- NumConverter(T? convert(StringView, ContextData), {required CommandOptionType type = CommandOptionType.string, T? min, T? max})
-
Create a new NumConverter.
const
Properties
-
autocompleteCallback
→ (FutureOr<
Iterable< Function(AutocompleteContext)?)CommandOptionChoiceBuilder> ?> -
A function called to provide autocompletion
for arguments of this type.
finalinherited
-
choices
→ Iterable<
CommandOptionChoiceBuilder> ? -
The choices for this type.
finalinherited
-
convert
→ FutureOr<
T?> Function(StringView view, ContextData context) -
The function called to perform the conversion.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- max → T?
-
The biggest value the user will be allows to input in the Discord Client.
final
- min → T?
-
The smallest value the user will be allowed to input in the Discord Client.
final
-
output
→ RuntimeType<
T> -
The type that this converter parses.
no setterinherited
- processOptionCallback → (void Function(CommandOptionBuilder)?)
-
A callback called with the CommandOptionBuilder created for an option using this converter.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toButton → ButtonBuilder Function(T)
-
A function called to provide ButtonBuilders that can be used to represent an element
converted by this converter.
no setteroverride
- toSelectMenuOption → SelectMenuOptionBuilder Function(T)
-
A function called to provide SelectMenuOptionBuilders that can be used to represent an
element converted by this converter.
no setteroverride
- type → CommandOptionType
-
The Discord Slash Command Argument Type
of the type that this converter parses.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited