Autocomplete class
An annotation used to override the callback used to handle autocomplete events for a specific argument.
For example, using the top-level function foo
as an autocomplete handler:
ChatCommand test = ChatCommand(
'test',
'A test command',
(
IChatContext context,
@Autocomplete(foo) String bar,
) async {
context.respond(MessageBuilder.content(bar));
},
);
commands.addCommand(test);
You might also be interested in:
- Converter.autocompleteCallback, the way to register autocomplete handlers for all arguments of a given type.
Constructors
-
Autocomplete(FutureOr<
Iterable< callback(AutocompleteContext))CommandOptionChoiceBuilder> ?> -
Create a new Autocomplete.
const
Properties
-
callback
→ FutureOr<
Iterable< Function(AutocompleteContext)CommandOptionChoiceBuilder> ?> -
The autocomplete handler to use.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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