# ContextMenuRoute

`function` in `seedcord` · v0.14.0

<https://docs.seedcord.org/packages/seedcord/0.14.0/functions/context-menu-route>

Routes one or more context-menu commands to a [`ContextMenuHandler`](/packages/seedcord/0.14.0/classes/context-menu-handler).

Pass the kind (`ApplicationCommandType.User` or `ApplicationCommandType.Message`) and the command name(s), each checked against that kind's registry, so a typo is a compile error. The same kind must sit on the handler's generic, cross-checked both directions. Context menus carry no options, so a multi-name handler reads `this.target` uniformly with no branch.

```ts
ContextMenuRoute<Kind>(
    kind: Kind,
    names: NamesFor<Kind>[]
): <
    TCtor extends new (
        ...args: any[]
    ) => InteractionHandler<Repliables>
>(
    constructor: AssertContextMenuRoute<Kind, TCtor>
) => void
```

Routes one or more context-menu commands to a [`ContextMenuHandler`](/packages/seedcord/0.14.0/classes/context-menu-handler).

Pass the kind (`ApplicationCommandType.User` or `ApplicationCommandType.Message`) and the command name(s), each checked against that kind's registry, so a typo is a compile error. The same kind must sit on the handler's generic, cross-checked both directions. Context menus carry no options, so a multi-name handler reads `this.target` uniformly with no branch.

Parameters.

- `kind` `Kind` — The context-menu kind, `ApplicationCommandType.User` or `ApplicationCommandType.Message`.
- `names` `NamesFor<Kind>[]` — The command name(s) this handler serves, keyed off the matching registry.

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