Skip to content
Interfacecorev0.12.0

AppPermissionsContext

The context an interaction provides on both transports, where Discord always sends the bot's channel permissions. A gate that requires it fits no event handler.

interface AppPermissionsContext extends GateContextBase

appPermissions

The bot's permissions in the invoked channel, the wire app_permissions value.

readonly appPermissions: bigint

channelId

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

readonly channelId: string | null

Inherited from:GateContextBase

dispatch

The bag for this dispatch, the same instance the handler and its middleware hold. Every middleware runs before the first gate. A gate can therefore read what a middleware wrote.

readonly dispatch: DispatchContext

Inherited from:GateContextBase

memberPermissions

The member's permission bits, or null outside a guild. On an interaction these are the channel-scoped permissions the payload contains, and on a gateway event they're the member's guild-level ones.

readonly memberPermissions: bigint | null

Inherited from:GateContextBase

memberRoleIds

The member's role ids without the everyone role, the shape a raw interaction payload contains. Empty outside a guild or when the source contains none.

readonly memberRoleIds: readonly string[]

Inherited from:GateContextBase

userId

The acting user's id, or null on an event that carries none.

readonly userId: string | null

Inherited from:GateContextBase