Autocomplete class Null safety

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<ArgChoiceBuilder>?> callback(AutocompleteContext))
Create a new Autocomplete.
const

Properties

callback FutureOr<Iterable<ArgChoiceBuilder>?> Function(AutocompleteContext)
The autocomplete handler to use.
final
hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

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