# SlashRoute

`function` in `seedcord` · v0.13.0

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

Routes one or more slash commands to a [`SlashHandler`](/packages/seedcord/0.13.0/classes/slash-handler).

Pass the same route string(s) as the handler's generic. A single command reads `this.options`, several commands branch with `this.match`. The decorator routes and the generic must match exactly, so listing fewer or more than the handler declares is a compile error. Subcommands use a slash path.

```ts
SlashRoute<Route>(
    routes: Route[]
): <
    TCtor extends new (
        ...args: any[]
    ) => InteractionHandler<Repliables>
>(
    constructor: AssertSlashRoute<Route, TCtor>
) => void
```

Routes one or more slash commands to a [`SlashHandler`](/packages/seedcord/0.13.0/classes/slash-handler).

Pass the same route string(s) as the handler's generic. A single command reads `this.options`, several commands branch with `this.match`. The decorator routes and the generic must match exactly, so listing fewer or more than the handler declares is a compile error. Subcommands use a slash path.

Parameters.

- `routes` `Route[]` — The route string(s) this handler serves, e.g. `'ban'`, `'ban', 'kick'`, or `'demo/setup'`.

Returns `<TCtor extends new (...args: any[]) => InteractionHandler<Repliables>>(constructor: AssertSlashRoute<Route, TCtor>) => void`.
