# InteractionHandler

`class` in `http` · v0.1.0-next.0

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

Shared base the repliable interaction handlers extend.

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

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

## Constructors

### constructor

```ts
InteractionHandler(
    event: Event,
    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<
        Exclude<Repliables, APIModalSubmitInteraction>
    >,
    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).
