# InteractionGateContext

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

<https://docs.seedcord.org/packages/http/0.1.0-next.0/interfaces/interaction-gate-context>

The interaction gate context on the HTTP transport. It extends the scalar [`GateContextBase`](/packages/core/0.1.0-next.5/interfaces/gate-context-base) with the raw interaction payload and the user and member the payload carries. `Repliable` narrows which handlers a gate attaches to, inferred from the `ctx` annotation, so a gate reading button fields is rejected on a slash handler.

The http transport delivers no role-derived permission sets, so `memberGuildPermissions` and `appGuildPermissions` are absent. A gate requiring `GuildPermissionsContext` (a permission gate with `in: 'guild'`) is a compile error on an http handler.

```ts
interface InteractionGateContext<
    Repliable extends Repliables = Repliables
> extends GateContextBase
```

## Examples

```ts
import type { APIMessageComponentButtonInteraction } from 'discord-api-types/v10';

// a button-only gate: the Repliable generic narrows which handlers accept it
const ButtonGate = defineGate('btn', (ctx: InteractionGateContext<APIMessageComponentButtonInteraction>) => {
    void ctx.interaction; // APIMessageComponentButtonInteraction
});
```

## Properties

### core

```ts
readonly core: Core
```

### interaction

```ts
readonly interaction: Repliable
```

The raw interaction payload, which is the reply target.

### kind

```ts
readonly kind: 'interaction'
```

Narrow on this before reading `interaction`.

### member

```ts
readonly member: APIInteractionGuildMember | null
```

The invoking member, or null in a DM.

### user

```ts
readonly user: APIUser
```

Every repliable interaction contains a user, so this is never null.
