# SelectHandler

`class` in `seedcord` · v0.12.0

<https://docs.seedcord.org/packages/seedcord/0.12.0/classes/select-handler>

Base class for a select menu handler.

Pass the select kind first and the customId definitions second, the same order as `@SelectMenuRoute`, so `this.event` and `this.event.values` are narrowed to that kind. Read `this.params` for a single route or `this.match` for several.

```ts
abstract class SelectHandler<
    Kind extends SelectMenuType,
    Defs extends readonly AnyCustomId[],
    Cache extends CacheType = "cached"
> extends ComponentHandler<SelectMenuInteractionFor<Kind, Cache>, Defs>
```

## Examples

```ts
\@SelectMenuRoute(SelectMenuType.User, AssignId)
class AssignSelect extends SelectHandler<SelectMenuType.User, [typeof AssignId]> {
    \@Catchable()
    async execute() {
        const { roleId } = this.params;
        await this.event.reply(`assigning ${this.event.values.length} member(s) to <@&${roleId}>`);
    }
}
```
