abstract class AutocompleteHandler<
Route extends keyof SlashRegistry
> extends BaseHandler<APIApplicationCommandAutocompleteInteraction, Core>Member visibility
Filter class members by access level.
AutocompleteHandler(
event: APIApplicationCommandAutocompleteInteraction,
core: Core,
dispatch: DispatchContext
)Route
One or more route keys from SlashRegistry, e.g. 'search'.
Route extends keyof SlashRegistryprotected api: APIcore
readonly core: TCoreInherited from:BaseHandler
dispatch
The bag for this dispatch. Each interaction gets its own. Every handler for one event shares a single bag.
protected readonly dispatch: DispatchContextInherited from:BaseHandler
event
protected readonly event: EventInherited from:BaseHandler
protected focused: FocusedField<Route>logger
protected readonly logger: LoggerInherited from:BaseHandler
protected options: AutocompleteOptions<Route>protected route: Routeexecute()
Holds the main logic of your handler. The dispatcher calls it after the handler's gates pass, so a gate that refuses stops execute() from running.
Inherited from:BaseHandler
Run the arm for the focused field. An autocomplete always dispatches by which field is focused. Match is how you read it.
Provide one arm per autocompletable field across the registered commands, keyed by field name. Each arm receives the focused partial value and a respond typed to that field's choice value. The arms must cover every autocompletable field, a missing field or an unknown key is a compile error. A focused field with no arm, only reachable from a stale-deployed command, throws at runtime.
protected async match<Ret>(
arms: FocusedArms<Route, Ret>
): Promise<Ret>armsOne handler per autocompletable field, keyed by field name.
Send autocomplete suggestions, callback type 8. Prefer match, which restricts each field's choices to its declared type.
protected async respond(
choices: readonly APIApplicationCommandOptionChoice[]
): Promise<void>