# AutocompleteRoute

`function` in `seedcord` · v0.13.0

<https://docs.seedcord.org/packages/seedcord/0.13.0/functions/autocomplete-route>

Routes one or more commands' autocomplete to an [`AutocompleteHandler`](/packages/seedcord/0.13.0/classes/autocomplete-handler).

Pass the same command route string(s) as the handler's generic. One command branches with `this.match` over its autocompletable fields, several commands share one handler whose arms span every command's fields. The decorator routes and the generic must match exactly, so listing fewer or more than the handler declares is a compile error.

```ts
AutocompleteRoute<Route>(
    routes: Route[]
): <
    TCtor extends new (
        ...args: any[]
    ) => BaseHandler<AutocompleteInteraction<CacheType>>
>(
    constructor: AssertAutocompleteRoute<Route, TCtor>
) => void
```

Routes one or more commands' autocomplete to an [`AutocompleteHandler`](/packages/seedcord/0.13.0/classes/autocomplete-handler).

Pass the same command route string(s) as the handler's generic. One command branches with `this.match` over its autocompletable fields, several commands share one handler whose arms span every command's fields. The decorator routes and the generic must match exactly, so listing fewer or more than the handler declares is a compile error.

Parameters.

- `routes` `Route[]` — The command route string(s) this handler serves, e.g. `'search'` or `'search', 'find'`.

Returns `<TCtor extends new (...args: any[]) => BaseHandler<AutocompleteInteraction<CacheType>>>(constructor: AssertAutocompleteRoute<Route, TCtor>) => void`.
