# InteractionGateContext

`interface` in `seedcord` · v0.14.0

<https://docs.seedcord.org/packages/seedcord/0.14.0/interfaces/interaction-gate-context>

The interaction arm. `Repliable` is the interaction type the gate supports, inferred from the `ctx` annotation, so a gate reading button-specific fields is rejected on a slash handler. `interaction` is the reply target, so `user` is always present. Use [`NonModalInteraction`](/packages/seedcord/0.14.0/types/non-modal-interaction) to exclude ModalSubmit when the gate needs a reliable caller member or channel.

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

## Examples

```ts
import type { ButtonInteraction } from 'discord.js';

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

## Properties

### channelId

```ts
readonly channelId: string | null
```

The channel id, or null when the source carries none.

### core

```ts
readonly core: Core
```

The running framework, for reaching the bot, config, the rate limiter, and the bus.

### guild

```ts
readonly guild: Guild | null
```

The guild the action happened in, or null in a DM or a guildless event.

### guildId

```ts
readonly guildId: string | null
```

The guild id, or null outside a guild.

### interaction

```ts
readonly interaction: Repliable
```

The interaction being handled, which is the reply target.

### kind

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

Marks the interaction arm, narrow on it before reading `interaction`.

### member

```ts
readonly member: GuildMember | null
```

The acting member, or null outside a guild or when uncached.

### user

```ts
readonly user: User
```

The invoking user, always present on an interaction.
