# InteractionHandler

`class` in `http` · v0.2.3

<https://docs.seedcord.org/packages/http/0.2.3/classes/interaction-handler>

Shared base the repliable interaction handlers extend.

Not a public entry point. Extend [`SlashHandler`](/packages/http/0.2.3/classes/slash-handler), [`ContextMenuHandler`](/packages/http/0.2.3/classes/context-menu-handler), [`ButtonHandler`](/packages/http/0.2.3/classes/button-handler), [`SelectMenuHandler`](/packages/http/0.2.3/classes/select-menu-handler), or [`ModalHandler`](/packages/http/0.2.3/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

## Properties

### api

```ts
protected api: API
```

Typed Discord REST API (`@discordjs/core/http-only`) over `core.rest`, one instance per core. The interaction callbacks on `api.interactions` bypass the reply surface. The `no-raw-interaction-acks` rule flags them in handler classes.

## 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).
