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:

Constructors

Autocomplete(FutureOr<Iterable<CommandOptionChoiceBuilder>?> callback(AutocompleteContext))
Create a new Autocomplete.
const

Properties

callback FutureOr<Iterable<CommandOptionChoiceBuilder>?> Function(AutocompleteContext)
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