# ButtonRoute

`function` in `seedcord` · v0.11.0

<https://docs.seedcord.org/packages/seedcord/0.11.0/functions/button-route>

Routes button interactions to handler classes

Matches the customId prefix before the first colon.

For customId `accept:user123`, use `@ButtonRoute("accept")`.

```ts
ButtonRoute(
    routeOrRoutes: string | string[]
): <
    TCtor extends new (
        ...args: any[]
    ) => InteractionHandler<Repliables>
>(
    constructor: AssertHandles<ButtonInteraction, TCtor>
) => void
```

Routes button interactions to handler classes

Matches the customId prefix before the first colon.

For customId `accept:user123`, use `@ButtonRoute("accept")`.

Parameters.

- `routeOrRoutes` `string | string[]` — CustomId prefix(es) to handle

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