# AppPermissionsContext

`interface` in `core` · v0.12.0

<https://seedcord.org/docs/packages/core/0.12.0/interfaces/app-permissions-context>

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.

```ts
interface AppPermissionsContext extends GateContextBase
```

## Examples

```ts
// the default channel scope returns a Gate<AppPermissionsContext>
\@Gated(RequireBotPermissions([PermissionFlagsBits.ManageMessages]))
```

## Properties

### appPermissions

```ts
readonly appPermissions: bigint
```

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

### channelId

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

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

### core

```ts
readonly core: CoreBase
```

Gates read the config and the rate limiter through it.

### dispatch

```ts
readonly dispatch: DispatchContext
```

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.

### guildId

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

The guild id, or null outside a guild.

### memberPermissions

```ts
readonly memberPermissions: bigint | null
```

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.

### memberRoleIds

```ts
readonly memberRoleIds: readonly string[]
```

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.

### userId

```ts
readonly userId: string | null
```

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