# InteractionHandler

`class` in `gateway` · v0.1.0-next.3

<https://docs.seedcord.org/packages/gateway/0.1.0-next.3/classes/interaction-handler>

Shared base the typed interaction handlers extend.

Not a public entry point. Extend [`SlashHandler`](/packages/gateway/0.1.0-next.3/classes/slash-handler), [`ButtonHandler`](/packages/gateway/0.1.0-next.3/classes/button-handler), [`ModalHandler`](/packages/gateway/0.1.0-next.3/classes/modal-handler), or [`SelectMenuHandler`](/packages/gateway/0.1.0-next.3/classes/select-menu-handler) instead. This class adds `showModal` on top of the reply members those bases share.

```ts
abstract class InteractionHandler<
    Repliable extends Repliables
> extends RepliableHandler<Repliable>
```

## Constructors

### constructor

```ts
InteractionHandler(
    event: Repliable,
    core: Core,
    dispatch?: DispatchContext
)
```

Constructs a new instance of the `InteractionHandler` class

## Methods

### buildSender

```ts
protected buildSender(
    event: Event,
    _core: Core,
    routeId: string
): ReplySender
```

### showModal

```ts
protected async showModal(
    this: InteractionHandler<NonModalInteraction>,
    modal: ModalLike
): Promise<void>
```

Open a modal. Must be the initial response to this interaction. The modal kind rejects this call at compile time (Discord forbids a modal in response to a modal).
