> ## Documentation Index
> Fetch the complete documentation index at: https://docs.discord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gateway Events

> Complete reference for all Gateway events.

export const ManualAnchor = ({id}) => {
  return <div className="MDXManualAnchor" id={id}></div>;
};

Gateway connections are WebSockets, meaning they're bidirectional and either side of the WebSocket can send events to the other. The following events are split up into two types:

* **Send events** are Gateway events sent by an app to Discord (like when identifying with the Gateway)
* **Receive events** are Gateway events that are sent by Discord to an app. These events typically represent something happening inside of a server where an app is installed, like a channel being updated.

All Gateway events are encapsulated in a [Gateway event payload](/developers/events/gateway-events#payload-structure).

For more information about interacting with the Gateway, you can reference the [Gateway documentation](/developers/events/gateway).

<Warning>
  Not all Gateway event fields are documented. You should assume that undocumented fields are not supported for apps, and their format and data may change at any time.
</Warning>

### Event Names

In practice, event names are UPPER-CASED with under\_scores joining each word in the name. For instance, [Channel Create](/developers/events/gateway-events#channel-create) would be `CHANNEL_CREATE` and [Voice State Update](/developers/events/gateway-events#voice-state-update) would be `VOICE_STATE_UPDATE`.

For readability, event names in the following documentation are typically left in Title Case.

### Payload Structure

Gateway event payloads have a common structure, but the contents of the associated data (`d`) varies between the different events.

| Field | Type                    | Description                                                                                                                                                  |
| ----- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| op    | integer                 | [Gateway opcode](/developers/topics/opcodes-and-status-codes#gateway-gateway-opcodes), which indicates the payload type                                      |
| d     | ?mixed (any JSON value) | Event data                                                                                                                                                   |
| s     | ?integer \*             | Sequence number of event used for [resuming sessions](/developers/events/gateway#resuming) and [heartbeating](/developers/events/gateway#sending-heartbeats) |
| t     | ?string \*              | Event name                                                                                                                                                   |

\* `s` and `t` are `null` when `op` is not `0` ([Gateway Dispatch opcode](/developers/topics/opcodes-and-status-codes#gateway-gateway-opcodes)).

<ManualAnchor id="payload-structure-example-gateway-event-payload" />

###### Example Gateway Event Payload

```json theme={"system"}
{
  "op": 0,
  "d": {},
  "s": 42,
  "t": "GATEWAY_EVENT_NAME"
}
```

## Send Events

Send events are Gateway events encapsulated in an [event payload](/developers/events/gateway-events#payload-structure), and are sent by an app to Discord through a Gateway connection.

<Info>
  Previously, Gateway send events were labeled as commands
</Info>

| Name                                                                                     | Description                                               |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [Identify](/developers/events/gateway-events#identify)                                   | Triggers the initial handshake with the gateway           |
| [Resume](/developers/events/gateway-events#resume)                                       | Resumes a dropped gateway connection                      |
| [Heartbeat](/developers/events/gateway-events#heartbeat)                                 | Maintains an active gateway connection                    |
| [Request Guild Members](/developers/events/gateway-events#request-guild-members)         | Requests members for a guild                              |
| [Request Soundboard Sounds](/developers/events/gateway-events#request-soundboard-sounds) | Requests soundboard sounds in a set of guilds             |
| [Request Channel Info](/developers/events/gateway-events#request-channel-info)           | Requests ephemeral channel data for channels in a guild   |
| [Update Voice State](/developers/events/gateway-events#update-voice-state)               | Joins, moves, or disconnects the app from a voice channel |
| [Update Presence](/developers/events/gateway-events#update-presence)                     | Updates an app's presence                                 |

#### Identify

Used to trigger the initial handshake with the gateway.

Details about identifying is in the [Gateway documentation](/developers/events/gateway#identifying).

<ManualAnchor id="identify-identify-structure" />

###### Identify Structure

| Field             | Type                                                                        | Description                                                                                                                    | Default |
| ----------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------- |
| token             | string                                                                      | Authentication token                                                                                                           | -       |
| properties        | object                                                                      | [Connection properties](/developers/events/gateway-events#identify-identify-connection-properties)                             | -       |
| compress?         | boolean                                                                     | Whether this connection supports compression of packets                                                                        | false   |
| large\_threshold? | integer                                                                     | Value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list | 50      |
| shard?            | array of two integers (shard\_id, num\_shards)                              | Used for [Guild Sharding](/developers/events/gateway#sharding)                                                                 | -       |
| presence?         | [update presence](/developers/events/gateway-events#update-presence) object | Presence structure for initial presence information                                                                            | -       |
| intents           | integer                                                                     | [Gateway Intents](/developers/events/gateway#gateway-intents) you wish to receive                                              | -       |

<ManualAnchor id="identify-identify-connection-properties" />

###### Identify Connection Properties

| Field   | Type   | Description           |
| ------- | ------ | --------------------- |
| os      | string | Your operating system |
| browser | string | Your library name     |
| device  | string | Your library name     |

<Warning>
  These fields originally were $ prefixed (i.e: `$browser\`) but [this syntax is deprecated](/developers/change-log#updated-connection-property-field-names). While they currently still work, it is recommended to move to non-prefixed fields.
</Warning>

<ManualAnchor id="identify-example-identify" />

###### Example Identify

```json theme={"system"}
{
  "op": 2,
  "d": {
    "token": "my_token",
    "properties": {
      "os": "linux",
      "browser": "disco",
      "device": "disco"
    },
    "compress": true,
    "large_threshold": 250,
    "shard": [0, 1],
    "presence": {
      "activities": [{
        "name": "Cards Against Humanity",
        "type": 0
      }],
      "status": "dnd",
      "since": 91879201,
      "afk": false
    },
    // These intents represent 1 << 0 for GUILDS and 1 << 2 for GUILD_MODERATION
    // This connection will only receive the events defined in those two intents
    "intents": 5
  }
}
```

#### Resume

Used to replay missed events when a disconnected client resumes.

Details about resuming are in the [Gateway documentation](/developers/events/gateway#resuming).

<ManualAnchor id="resume-resume-structure" />

###### Resume Structure

| Field       | Type    | Description                   |
| ----------- | ------- | ----------------------------- |
| token       | string  | Session token                 |
| session\_id | string  | Session ID                    |
| seq         | integer | Last sequence number received |

<ManualAnchor id="resume-example-resume" />

###### Example Resume

```json theme={"system"}
{
  "op": 6,
  "d": {
    "token": "randomstring",
    "session_id": "evenmorerandomstring",
    "seq": 1337
  }
}
```

#### Heartbeat

Used to maintain an active gateway connection. Must be sent every `heartbeat_interval` milliseconds after the [Opcode 10 Hello](/developers/events/gateway-events#hello) payload is received. The inner `d` key is the last sequence number—`s`—received by the client. If you have not yet received one, send `null`.

Details about heartbeats are in the [Gateway documentation](/developers/events/gateway#sending-heartbeats).

<ManualAnchor id="heartbeat-example-heartbeat" />

###### Example Heartbeat

```json theme={"system"}
{
  "op": 1,
  "d": 251
}
```

#### Request Guild Members

Used to request all members for a guild or a list of guilds. When initially connecting, if you don't have the `GUILD_PRESENCES` [Gateway Intent](/developers/events/gateway#gateway-intents), or if the guild is over 75k members, it will only send members who are in voice, plus the member for you (the connecting user). Otherwise, if a guild has over `large_threshold` members (value in the [Gateway Identify](/developers/events/gateway-events#identify)), it will only send members who are online, have a role, have a nickname, or are in a voice channel, and if it has under `large_threshold` members, it will send all members. If a client wishes to receive additional members, they need to explicitly request them via this operation. The server will send [Guild Members Chunk](/developers/events/gateway-events#guild-members-chunk) events in response with up to 1000 members per chunk until all members that match the request have been sent.

Due to our privacy and infrastructural concerns with this feature, there are some limitations that apply:

* `GUILD_PRESENCES` intent is required to set `presences = true`. Otherwise, it will always be false
* `GUILD_MEMBERS` intent is required to request the entire member list—`(query=‘’, limit=0<=n)`
* You will be limited to requesting 1 `guild_id` per request
* Requesting a prefix (`query` parameter) will return a maximum of 100 members
* Requesting `user_ids` will continue to be limited to returning 100 members

<Info>
  We are introducing a new rate limit to the Request Guild Members opcode. See [Introducing Rate Limit When Requesting All Guild Members](/developers/change-log#introducing-rate-limit-when-requesting-all-guild-members) for more information and timeline on this new rate limit.
</Info>

<ManualAnchor id="request-guild-members-request-guild-members-structure" />

###### Request Guild Members Structure

| Field      | Type                             | Description                                                                                                                           | Required                   |
| ---------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| guild\_id  | snowflake                        | ID of the guild to get members for                                                                                                    | true                       |
| query?     | string                           | string that username starts with, or an empty string to return all members                                                            | one of query or user\_ids  |
| limit      | integer                          | maximum number of members to send matching the `query`; a limit of `0` can be used with an empty string `query` to return all members | true when specifying query |
| presences? | boolean                          | used to specify if we want the presences of the matched members                                                                       | false                      |
| user\_ids? | snowflake or array of snowflakes | used to specify which users you wish to fetch                                                                                         | one of query or user\_ids  |
| nonce?     | string                           | nonce to identify the [Guild Members Chunk](/developers/events/gateway-events#guild-members-chunk) response                           | false                      |

<Info>
  Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member\_chunk(s) will not have a nonce set.
</Info>

<ManualAnchor id="request-guild-members-example-request-guild-members" />

###### Example Request Guild Members

```json theme={"system"}
{
  "op": 8,
  "d": {
    "guild_id": "41771983444115456",
    "query": "",
    "limit": 0
  }
}
```

#### Request Soundboard Sounds

Used to request soundboard sounds for a list of guilds. The server will send [Soundboard Sounds](/developers/events/gateway-events#soundboard-sounds) events for each guild in response.

<ManualAnchor id="request-soundboard-sounds-request-soundboard-sounds-structure" />

###### Request Soundboard Sounds Structure

| Field      | Type                | Description                                    |
| ---------- | ------------------- | ---------------------------------------------- |
| guild\_ids | array of snowflakes | IDs of the guilds to get soundboard sounds for |

<ManualAnchor id="request-soundboard-sounds-example-request-soundboard-sounds" />

###### Example Request Soundboard Sounds

```json theme={"system"}
{
  "op": 31,
  "d": {
    "guild_ids": ["613425648685547541", "81384788765712384"]
  }
}
```

### Request Channel Info

Requests ephemeral channel data for channels in a guild. The server will send a [Channel Info](/developers/events/gateway-events#channel-info) event in response.

<ManualAnchor id="request-channel-info-request-channel-info-structure" />

###### Request Channel Info Structure

| Field     | Type             | Description                                                                              |
| --------- | ---------------- | ---------------------------------------------------------------------------------------- |
| guild\_id | snowflake        | The guild id to request channel info for                                                 |
| fields    | array of strings | The fields to request. The current available fields are `status` and `voice_start_time`. |

<ManualAnchor id="request-channel-info-example-request-channel-info" />

###### Example Request Channel Info

```json theme={"system"}
{
  "guild_id": "613425648685547541",
  "fields": ["status", "voice_start_time"]
}
```

#### Update Voice State

Sent when a client wants to join, move, or disconnect from a voice channel.

<ManualAnchor id="update-voice-state-gateway-voice-state-update-structure" />

###### Gateway Voice State Update Structure

| Field       | Type       | Description                                                          |
| ----------- | ---------- | -------------------------------------------------------------------- |
| guild\_id   | snowflake  | ID of the guild                                                      |
| channel\_id | ?snowflake | ID of the voice channel client wants to join (null if disconnecting) |
| self\_mute  | boolean    | Whether the client is muted                                          |
| self\_deaf  | boolean    | Whether the client deafened                                          |

<ManualAnchor id="update-voice-state-example-gateway-voice-state-update" />

###### Example Gateway Voice State Update

```json theme={"system"}
{
  "op": 4,
  "d": {
    "guild_id": "41771983423143937",
    "channel_id": "127121515262115840",
    "self_mute": false,
    "self_deaf": false
  }
}
```

#### Update Presence

Sent by the client to indicate a presence or status update.

<ManualAnchor id="update-presence-gateway-presence-update-structure" />

###### Gateway Presence Update Structure

| Field      | Type                                                                           | Description                                                                                 |
| ---------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
| since      | ?integer                                                                       | Unix time (in milliseconds) of when the client went idle, or null if the client is not idle |
| activities | array of [activity](/developers/events/gateway-events#activity-object) objects | User's activities                                                                           |
| status     | string                                                                         | User's new [status](/developers/events/gateway-events#update-presence-status-types)         |
| afk        | boolean                                                                        | Whether or not the client is afk                                                            |

<ManualAnchor id="update-presence-status-types" />

###### Status Types

| Status    | Description                    |
| --------- | ------------------------------ |
| online    | Online                         |
| dnd       | Do Not Disturb                 |
| idle      | AFK                            |
| invisible | Invisible and shown as offline |
| offline   | Offline                        |

<ManualAnchor id="update-presence-example-gateway-presence-update" />

###### Example Gateway Presence Update

```json theme={"system"}
{
  "op": 3,
  "d": {
    "since": 91879201,
    "activities": [{
      "name": "Save the Oxford Comma",
      "type": 0
    }],
    "status": "online",
    "afk": false
  }
}
```

## Receive Events

Receive events are Gateway events encapsulated in an [event payload](/developers/events/gateway-events#payload-structure), and are sent by Discord to an app through a Gateway connection. Receive events correspond to events that happen in a Discord server where the app is installed.

| Name                                                                                                               | Description                                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Hello](/developers/events/gateway-events#hello)                                                                   | Defines the heartbeat interval                                                                                                                             |
| [Ready](/developers/events/gateway-events#ready)                                                                   | Contains the initial state information                                                                                                                     |
| [Resumed](/developers/events/gateway-events#resumed)                                                               | Response to [Resume](/developers/events/gateway-events#resume)                                                                                             |
| [Reconnect](/developers/events/gateway-events#reconnect)                                                           | Server is going away, client should reconnect to gateway and resume                                                                                        |
| [Rate Limited](/developers/events/gateway-events#rate-limited)                                                     | Application was rate limited for a gateway opcode                                                                                                          |
| [Invalid Session](/developers/events/gateway-events#invalid-session)                                               | Failure response to [Identify](/developers/events/gateway-events#identify) or [Resume](/developers/events/gateway-events#resume) or invalid active session |
| [Application Command Permissions Update](/developers/events/gateway-events#application-command-permissions-update) | Application command permission was updated                                                                                                                 |
| [Auto Moderation Rule Create](/developers/events/gateway-events#auto-moderation-rule-create)                       | Auto Moderation rule was created                                                                                                                           |
| [Auto Moderation Rule Update](/developers/events/gateway-events#auto-moderation-rule-update)                       | Auto Moderation rule was updated                                                                                                                           |
| [Auto Moderation Rule Delete](/developers/events/gateway-events#auto-moderation-rule-delete)                       | Auto Moderation rule was deleted                                                                                                                           |
| [Auto Moderation Action Execution](/developers/events/gateway-events#auto-moderation-action-execution)             | Auto Moderation rule was triggered and an action was executed (e.g. a message was blocked)                                                                 |
| [Channel Create](/developers/events/gateway-events#channel-create)                                                 | New guild channel created                                                                                                                                  |
| [Channel Update](/developers/events/gateway-events#channel-update)                                                 | Channel was updated                                                                                                                                        |
| [Channel Delete](/developers/events/gateway-events#channel-delete)                                                 | Channel was deleted                                                                                                                                        |
| [Channel Info](/developers/events/gateway-events#channel-info)                                                     | Response to [Request Channel Info](/developers/events/gateway-events#request-channel-info)                                                                 |
| [Channel Pins Update](/developers/events/gateway-events#channel-pins-update)                                       | Message was pinned or unpinned                                                                                                                             |
| [Thread Create](/developers/events/gateway-events#thread-create)                                                   | Thread created, also sent when being added to a private thread                                                                                             |
| [Thread Update](/developers/events/gateway-events#thread-update)                                                   | Thread was updated                                                                                                                                         |
| [Thread Delete](/developers/events/gateway-events#thread-delete)                                                   | Thread was deleted                                                                                                                                         |
| [Thread List Sync](/developers/events/gateway-events#thread-list-sync)                                             | Sent when gaining access to a channel, contains all active threads in that channel                                                                         |
| [Thread Member Update](/developers/events/gateway-events#thread-member-update)                                     | [Thread member](/developers/resources/channel#thread-member-object) for the current user was updated                                                       |
| [Thread Members Update](/developers/events/gateway-events#thread-members-update)                                   | Some user(s) were added to or removed from a thread                                                                                                        |
| [Entitlement Create](/developers/events/gateway-events#entitlement-create)                                         | Entitlement was created                                                                                                                                    |
| [Entitlement Update](/developers/events/gateway-events#entitlement-update)                                         | Entitlement was updated or renewed                                                                                                                         |
| [Entitlement Delete](/developers/events/gateway-events#entitlement-delete)                                         | Entitlement was deleted                                                                                                                                    |
| [Guild Create](/developers/events/gateway-events#guild-create)                                                     | Lazy-load for unavailable guild, guild became available, or user joined a new guild                                                                        |
| [Guild Update](/developers/events/gateway-events#guild-update)                                                     | Guild was updated                                                                                                                                          |
| [Guild Delete](/developers/events/gateway-events#guild-delete)                                                     | Guild became unavailable, or user left/was removed from a guild                                                                                            |
| [Guild Audit Log Entry Create](/developers/events/gateway-events#guild-audit-log-entry-create)                     | A guild audit log entry was created                                                                                                                        |
| [Guild Ban Add](/developers/events/gateway-events#guild-ban-add)                                                   | User was banned from a guild                                                                                                                               |
| [Guild Ban Remove](/developers/events/gateway-events#guild-ban-remove)                                             | User was unbanned from a guild                                                                                                                             |
| [Guild Emojis Update](/developers/events/gateway-events#guild-emojis-update)                                       | Guild emojis were updated                                                                                                                                  |
| [Guild Stickers Update](/developers/events/gateway-events#guild-stickers-update)                                   | Guild stickers were updated                                                                                                                                |
| [Guild Integrations Update](/developers/events/gateway-events#guild-integrations-update)                           | Guild integration was updated                                                                                                                              |
| [Guild Member Add](/developers/events/gateway-events#guild-member-add)                                             | New user joined a guild                                                                                                                                    |
| [Guild Member Remove](/developers/events/gateway-events#guild-member-remove)                                       | User was removed from a guild                                                                                                                              |
| [Guild Member Update](/developers/events/gateway-events#guild-member-update)                                       | Guild member was updated                                                                                                                                   |
| [Guild Members Chunk](/developers/events/gateway-events#guild-members-chunk)                                       | Response to [Request Guild Members](/developers/events/gateway-events#request-guild-members)                                                               |
| [Guild Role Create](/developers/events/gateway-events#guild-role-create)                                           | Guild role was created                                                                                                                                     |
| [Guild Role Update](/developers/events/gateway-events#guild-role-update)                                           | Guild role was updated                                                                                                                                     |
| [Guild Role Delete](/developers/events/gateway-events#guild-role-delete)                                           | Guild role was deleted                                                                                                                                     |
| [Guild Scheduled Event Create](/developers/events/gateway-events#guild-scheduled-event-create)                     | Guild scheduled event was created                                                                                                                          |
| [Guild Scheduled Event Update](/developers/events/gateway-events#guild-scheduled-event-update)                     | Guild scheduled event was updated                                                                                                                          |
| [Guild Scheduled Event Delete](/developers/events/gateway-events#guild-scheduled-event-delete)                     | Guild scheduled event was deleted                                                                                                                          |
| [Guild Scheduled Event User Add](/developers/events/gateway-events#guild-scheduled-event-user-add)                 | User subscribed to a guild scheduled event                                                                                                                 |
| [Guild Scheduled Event User Remove](/developers/events/gateway-events#guild-scheduled-event-user-remove)           | User unsubscribed from a guild scheduled event                                                                                                             |
| [Guild Soundboard Sound Create](/developers/events/gateway-events#guild-soundboard-sound-create)                   | Guild soundboard sound was created                                                                                                                         |
| [Guild Soundboard Sound Update](/developers/events/gateway-events#guild-soundboard-sound-update)                   | Guild soundboard sound was updated                                                                                                                         |
| [Guild Soundboard Sound Delete](/developers/events/gateway-events#guild-soundboard-sound-delete)                   | Guild soundboard sound was deleted                                                                                                                         |
| [Guild Soundboard Sounds Update](/developers/events/gateway-events#guild-soundboard-sounds-update)                 | Guild soundboard sounds were updated                                                                                                                       |
| [Soundboard Sounds](/developers/events/gateway-events#soundboard-sounds)                                           | Response to [Request Soundboard Sounds](/developers/events/gateway-events#request-soundboard-sounds)                                                       |
| [Integration Create](/developers/events/gateway-events#integration-create)                                         | Guild integration was created                                                                                                                              |
| [Integration Update](/developers/events/gateway-events#integration-update)                                         | Guild integration was updated                                                                                                                              |
| [Integration Delete](/developers/events/gateway-events#integration-delete)                                         | Guild integration was deleted                                                                                                                              |
| [Interaction Create](/developers/events/gateway-events#interaction-create)                                         | User used an interaction, such as an [Application Command](/developers/interactions/application-commands)                                                  |
| [Invite Create](/developers/events/gateway-events#invite-create)                                                   | Invite to a channel was created                                                                                                                            |
| [Invite Delete](/developers/events/gateway-events#invite-delete)                                                   | Invite to a channel was deleted                                                                                                                            |
| [Message Create](/developers/events/gateway-events#message-create)                                                 | Message was created                                                                                                                                        |
| [Message Update](/developers/events/gateway-events#message-update)                                                 | Message was edited                                                                                                                                         |
| [Message Delete](/developers/events/gateway-events#message-delete)                                                 | Message was deleted                                                                                                                                        |
| [Message Delete Bulk](/developers/events/gateway-events#message-delete-bulk)                                       | Multiple messages were deleted at once                                                                                                                     |
| [Message Reaction Add](/developers/events/gateway-events#message-reaction-add)                                     | User reacted to a message                                                                                                                                  |
| [Message Reaction Remove](/developers/events/gateway-events#message-reaction-remove)                               | User removed a reaction from a message                                                                                                                     |
| [Message Reaction Remove All](/developers/events/gateway-events#message-reaction-remove-all)                       | All reactions were explicitly removed from a message                                                                                                       |
| [Message Reaction Remove Emoji](/developers/events/gateway-events#message-reaction-remove-emoji)                   | All reactions for a given emoji were explicitly removed from a message                                                                                     |
| [Presence Update](/developers/events/gateway-events#presence-update)                                               | User was updated                                                                                                                                           |
| [Stage Instance Create](/developers/events/gateway-events#stage-instance-create)                                   | Stage instance was created                                                                                                                                 |
| [Stage Instance Update](/developers/events/gateway-events#stage-instance-update)                                   | Stage instance was updated                                                                                                                                 |
| [Stage Instance Delete](/developers/events/gateway-events#stage-instance-delete)                                   | Stage instance was deleted or closed                                                                                                                       |
| [Subscription Create](/developers/events/gateway-events#subscription-create)                                       | Premium App Subscription was created                                                                                                                       |
| [Subscription Update](/developers/events/gateway-events#subscription-update)                                       | Premium App Subscription was updated                                                                                                                       |
| [Subscription Delete](/developers/events/gateway-events#subscription-delete)                                       | Premium App Subscription was deleted                                                                                                                       |
| [Typing Start](/developers/events/gateway-events#typing-start)                                                     | User started typing in a channel                                                                                                                           |
| [User Update](/developers/events/gateway-events#user-update)                                                       | Properties about the user changed                                                                                                                          |
| [Voice Channel Effect Send](/developers/events/gateway-events#voice-channel-effect-send)                           | Someone sent an effect in a voice channel the current user is connected to                                                                                 |
| [Voice Channel Start Time Update](/developers/events/gateway-events#voice-channel-start-time-update)               | Voice channel start time was updated                                                                                                                       |
| [Voice Channel Status Update](/developers/events/gateway-events#voice-channel-status-update)                       | Voice channel status was updated                                                                                                                           |
| [Voice State Update](/developers/events/gateway-events#voice-state-update)                                         | Someone joined, left, or moved a voice channel                                                                                                             |
| [Voice Server Update](/developers/events/gateway-events#voice-server-update)                                       | Guild's voice server was updated                                                                                                                           |
| [Webhooks Update](/developers/events/gateway-events#webhooks-update)                                               | Guild channel webhook was created, update, or deleted                                                                                                      |
| [Message Poll Vote Add](/developers/events/gateway-events#message-poll-vote-add)                                   | User voted on a poll                                                                                                                                       |
| [Message Poll Vote Remove](/developers/events/gateway-events#message-poll-vote-remove)                             | User removed a vote on a poll                                                                                                                              |

#### Hello

Sent on connection to the websocket. Defines the heartbeat interval that an app should heartbeat to.

<ManualAnchor id="hello-hello-structure" />

###### Hello Structure

| Field               | Type    | Description                                             |
| ------------------- | ------- | ------------------------------------------------------- |
| heartbeat\_interval | integer | Interval (in milliseconds) an app should heartbeat with |

<ManualAnchor id="hello-example-hello" />

###### Example Hello

```json theme={"system"}
{
  "op": 10,
  "d": {
    "heartbeat_interval": 45000
  }
}
```

#### Ready

The ready event is dispatched when a client has completed the initial handshake with the gateway (for new sessions). The ready event can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.

`guilds` are the guilds of which your bot is a member. They start out as unavailable when you connect to the gateway. As they become available, your bot will be notified via [Guild Create](/developers/events/gateway-events#guild-create) events.

<ManualAnchor id="ready-ready-event-fields" />

###### Ready Event Fields

| Field                | Type                                                                                       | Description                                                                                                     |
| -------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| v                    | integer                                                                                    | [API version](/developers/reference#api-versioning-api-versions)                                                |
| user                 | [user](/developers/resources/user#user-object) object                                      | Information about the user including email                                                                      |
| guilds               | array of [Unavailable Guild](/developers/resources/guild#unavailable-guild-object) objects | Guilds the user is in                                                                                           |
| session\_id          | string                                                                                     | Used for resuming connections                                                                                   |
| resume\_gateway\_url | string                                                                                     | Gateway URL for resuming connections                                                                            |
| shard?               | array of two integers (shard\_id, num\_shards)                                             | [Shard information](/developers/events/gateway#sharding) associated with this session, if sent when identifying |
| application          | partial [application object](/developers/resources/application#application-object)         | Contains `id` and `flags`                                                                                       |

#### Resumed

The resumed event is dispatched when a client has sent a [resume payload](/developers/events/gateway-events#resume) to the gateway (for resuming existing sessions).

#### Reconnect

The reconnect event is dispatched when a client should reconnect to the gateway (and resume their existing session, if they have one). This can occur at any point in the gateway connection lifecycle, even before/in place of receiving a [Hello](/developers/events/gateway-events#hello) event. A few seconds after the reconnect event is dispatched, the connection may be closed by the server.

<ManualAnchor id="reconnect-example-gateway-reconnect" />

###### Example Gateway Reconnect

```json theme={"system"}
{
  "op": 7,
  "d": null
}
```

#### Invalid Session

Sent to indicate one of at least three different situations:

* the gateway could not initialize a session after receiving an [Opcode 2 Identify](/developers/events/gateway-events#identify)
* the gateway could not resume a previous session after receiving an [Opcode 6 Resume](/developers/events/gateway-events#resume)
* the gateway has invalidated an active session and is requesting client action

The inner `d` key is a boolean that indicates whether the session may be resumable. See [Connecting](/developers/events/gateway#connecting) and [Resuming](/developers/events/gateway#resuming) for more information.

<ManualAnchor id="invalid-session-example-gateway-invalid-session" />

###### Example Gateway Invalid Session

```json theme={"system"}
{
  "op": 9,
  "d": false
}
```

### Application Commands

#### Application Command Permissions Update

`APPLICATION_COMMAND_PERMISSIONS_UPDATE` event, sent when an application command's permissions are updated. The inner payload is an [application command permissions](/developers/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure) object.

### Auto Moderation

All [Auto Moderation](/developers/resources/auto-moderation) related events are only sent to bot users which have the `MANAGE_GUILD` permission.

#### Auto Moderation Rule Create

Sent when a rule is created. The inner payload is an [auto moderation rule](/developers/resources/auto-moderation#auto-moderation-rule-object) object.

#### Auto Moderation Rule Update

Sent when a rule is updated. The inner payload is an [auto moderation rule](/developers/resources/auto-moderation#auto-moderation-rule-object) object.

#### Auto Moderation Rule Delete

Sent when a rule is deleted. The inner payload is an [auto moderation rule](/developers/resources/auto-moderation#auto-moderation-rule-object) object.

#### Auto Moderation Action Execution

Sent when a rule is triggered and an action is executed (e.g. when a message is blocked).

<ManualAnchor id="auto-moderation-action-execution-auto-moderation-action-execution-event-fields" />

###### Auto Moderation Action Execution Event Fields

| Field                       | Type                                                                                                 | Description                                                                      |
| --------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| guild\_id                   | snowflake                                                                                            | ID of the guild in which action was executed                                     |
| action                      | [auto moderation action](/developers/resources/auto-moderation#auto-moderation-action-object) object | Action which was executed                                                        |
| rule\_id                    | snowflake                                                                                            | ID of the rule which action belongs to                                           |
| rule\_trigger\_type         | [trigger\_type](/developers/resources/auto-moderation#auto-moderation-rule-object-trigger-types)     | Trigger type of rule which was triggered                                         |
| user\_id                    | snowflake                                                                                            | ID of the user which generated the content which triggered the rule              |
| channel\_id?                | snowflake                                                                                            | ID of the channel in which user content was posted                               |
| message\_id?                | snowflake                                                                                            | ID of any user message which content belongs to \*                               |
| alert\_system\_message\_id? | snowflake                                                                                            | ID of any system auto moderation messages posted as a result of this action \*\* |
| content \*\*\*              | string                                                                                               | User-generated text content                                                      |
| matched\_keyword            | ?string                                                                                              | Word or phrase configured in the rule that triggered the rule                    |
| matched\_content \*\*\*     | ?string                                                                                              | Substring in content that triggered the rule                                     |

\* `message_id` will not exist if message was blocked by [Auto Moderation](/developers/resources/auto-moderation) or content was not part of any message

\*\* `alert_system_message_id` will not exist if this event does not correspond to an action with type `SEND_ALERT_MESSAGE`

\*\*\* `MESSAGE_CONTENT` (`1 << 15`) [gateway intent](/developers/events/gateway#gateway-intents) is required to receive the `content` and `matched_content` fields

### Channels

#### Channel Create

Sent when a new guild channel is created, relevant to the current user. The inner payload is a [channel](/developers/resources/channel#channel-object) object.

#### Channel Update

Sent when a channel is updated. The inner payload is a [channel](/developers/resources/channel#channel-object) object. This is not sent when the field `last_message_id` is altered. To keep track of the last\_message\_id changes, you must listen for [Message Create](/developers/events/gateway-events#message-create) events (or [Thread Create](/developers/events/gateway-events#thread-create) events for `GUILD_FORUM` and `GUILD_MEDIA` channels).

This event may reference roles or guild members that no longer exist in the guild.

#### Channel Delete

Sent when a channel relevant to the current user is deleted. The inner payload is a [channel](/developers/resources/channel#channel-object) object.

#### Channel Info

Includes ephemeral data for channels in a guild. Sent in response to [Request Channel Info](/developers/events/gateway-events#request-channel-info).

<ManualAnchor id="channel-info-channel-info-structure" />

###### Channel Info Structure

| Field     | Type                                                                                                           | Description                              |
| --------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| guild\_id | snowflake                                                                                                      | The guild id                             |
| channels  | array of [channel info](/developers/events/gateway-events#channel-info-channel-info-channel-structure) objects | Ephemeral data for channels in the guild |

<ManualAnchor id="channel-info-channel-info-channel-structure" />

###### Channel Info Channel Structure

| Field               | Type      | Description                                                   |
| ------------------- | --------- | ------------------------------------------------------------- |
| id                  | snowflake | The channel id                                                |
| status?             | ?string   | The voice channel status                                      |
| voice\_start\_time? | ?integer  | Unix timestamp (in seconds) of when the voice session started |

#### Voice Channel Status Update

Sent when the voice channel status changes.

| Field     | Type      | Description                  |
| --------- | --------- | ---------------------------- |
| id        | snowflake | The channel id               |
| guild\_id | snowflake | The guild id                 |
| status    | ?string   | The new voice channel status |

#### Voice Channel Start Time Update

Sent when the voice channel start time changes.

| Field               | Type      | Description                                                   |
| ------------------- | --------- | ------------------------------------------------------------- |
| id                  | snowflake | The channel id                                                |
| guild\_id           | snowflake | The guild id                                                  |
| voice\_start\_time? | ?integer  | Unix timestamp (in seconds) of when the voice session started |

#### Thread Create

Sent when a thread is created, relevant to the current user, or when the current user is added to a thread. The inner payload is a [channel](/developers/resources/channel#channel-object) object.

* When a thread is created, includes an additional `newly_created` boolean field.
* When being added to an existing private thread, includes a [thread member](/developers/resources/channel#thread-member-object) object.

#### Thread Update

Sent when a thread is updated. The inner payload is a [channel](/developers/resources/channel#channel-object) object. This is not sent when the field `last_message_id` is altered. To keep track of the last\_message\_id changes, you must listen for [Message Create](/developers/events/gateway-events#message-create) events.

#### Thread Delete

Sent when a thread relevant to the current user is deleted. The inner payload is a subset of the [channel](/developers/resources/channel#channel-object) object, containing just the `id`, `guild_id`, `parent_id`, and `type` fields.

#### Thread List Sync

Sent when the current user *gains* access to a channel.

<ManualAnchor id="thread-list-sync-thread-list-sync-event-fields" />

###### Thread List Sync Event Fields

| Field         | Type                                                                                 | Description                                                                                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| guild\_id     | snowflake                                                                            | ID of the guild                                                                                                                                                                                                          |
| channel\_ids? | array of snowflakes                                                                  | Parent channel IDs whose threads are being synced.  If omitted, then threads were synced for the entire guild.  This array may contain channel\_ids that have no active threads as well, so you know to clear that data. |
| threads       | array of [channel](/developers/resources/channel#channel-object) objects             | All active threads in the given channels that the current user can access                                                                                                                                                |
| members       | array of [thread member](/developers/resources/channel#thread-member-object) objects | All thread member objects from the synced threads for the current user, indicating which threads the current user has been added to                                                                                      |

#### Thread Member Update

Sent when the [thread member](/developers/resources/channel#thread-member-object) object for the current user is updated. The inner payload is a [thread member](/developers/resources/channel#thread-member-object) object with an extra `guild_id` field. This event is documented for completeness, but unlikely to be used by most bots. For bots, this event largely is just a signal that you are a member of the thread. See the [threads docs](/developers/topics/threads) for more details.

<ManualAnchor id="thread-member-update-thread-member-update-event-extra-fields" />

###### Thread Member Update Event Extra Fields

| Field     | Type      | Description     |
| --------- | --------- | --------------- |
| guild\_id | snowflake | ID of the guild |

#### Thread Members Update

Sent when anyone is added to or removed from a thread.  If the current user does not have the `GUILD_MEMBERS` [Gateway Intent](/developers/events/gateway#gateway-intents), then this event will only be sent if the current user was added to or removed from the thread.

<ManualAnchor id="thread-members-update-thread-members-update-event-fields" />

###### Thread Members Update Event Fields

| Field                 | Type                                                                                 | Description                                               |
| --------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| id                    | snowflake                                                                            | ID of the thread                                          |
| guild\_id             | snowflake                                                                            | ID of the guild                                           |
| member\_count         | integer                                                                              | Approximate number of members in the thread, capped at 50 |
| added\_members?\*     | array of [thread member](/developers/resources/channel#thread-member-object) objects | Users who were added to the thread                        |
| removed\_member\_ids? | array of snowflakes                                                                  | ID of the users who were removed from the thread          |

\* In this gateway event, the thread member objects will also include the [guild member](/developers/resources/guild#guild-member-object) and nullable [presence](/developers/events/gateway-events#presence) objects for each added thread member.

#### Channel Pins Update

Sent when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted.

<ManualAnchor id="channel-pins-update-channel-pins-update-event-fields" />

###### Channel Pins Update Event Fields

| Field                 | Type               | Description                                             |
| --------------------- | ------------------ | ------------------------------------------------------- |
| guild\_id?            | snowflake          | ID of the guild                                         |
| channel\_id           | snowflake          | ID of the channel                                       |
| last\_pin\_timestamp? | ?ISO8601 timestamp | Time at which the most recent pinned message was pinned |

### Entitlements

#### Entitlement Create

<Warning>
  Note: The `ENTITLEMENT_CREATE` event behavior changed on October 1, 2024. Please see the [Change Log and Entitlement Migration Guide](/developers/change-log#premium-apps-entitlement-migration-and-new-subscription-api) for more information on what changed.
</Warning>

Sent when an entitlement is created. The inner payload is an [entitlement](/developers/resources/entitlement#entitlement-object) object.

#### Entitlement Update

<Warning>
  Note: The `ENTITLEMENT_UPDATE` event behavior changed on October 1, 2024. Please see the [Change Log and Entitlement Migration Guide](/developers/change-log#premium-apps-entitlement-migration-and-new-subscription-api) for more information on what changed.
</Warning>

Sent when an entitlement is updated. The inner payload is an [entitlement](/developers/resources/entitlement#entitlement-object) object.

For subscription entitlements, this event is triggered only when a user's subscription ends, providing an `ends_at` timestamp that indicates the end of the entitlement.

#### Entitlement Delete

Sent when an entitlement is deleted. The inner payload is an [entitlement](/developers/resources/entitlement#entitlement-object) object.

Entitlement deletions are infrequent, and occur when:

* Discord issues a refund for a subscription
* Discord removes an entitlement from a user via internal tooling
* Discord deletes an app-managed entitlement they created via the API

Entitlements are *not* deleted when they expire.

### Guilds

#### Guild Create

This event can be sent in three different scenarios:

1. When a user is initially connecting, to lazily load and backfill information for all unavailable guilds sent in the [Ready](/developers/events/gateway-events#ready) event. Guilds that are unavailable due to an outage will send a [Guild Delete](/developers/events/gateway-events#guild-delete) event.
2. When a Guild becomes available again to the client.
3. When the current user joins a new Guild.

<Info>
  During an outage, the guild object in scenarios 1 and 3 may be marked as unavailable.
</Info>

The inner payload can be:

* An available Guild: a [guild](/developers/resources/guild#guild-object) object with extra fields, as noted below.
* An unavailable Guild: an [unavailable guild](/developers/resources/guild#unavailable-guild-object) object.

<ManualAnchor id="guild-create-guild-create-extra-fields" />

###### Guild Create Extra Fields

| Field                    | Type                                                                                                               | Description                                                                                                                |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| joined\_at               | ISO8601 timestamp                                                                                                  | When this guild was joined at                                                                                              |
| large                    | boolean                                                                                                            | `true` if this is considered a large guild                                                                                 |
| unavailable?             | boolean                                                                                                            | `true` if this guild is unavailable due to an outage                                                                       |
| member\_count            | integer                                                                                                            | Total number of members in this guild                                                                                      |
| voice\_states            | array of partial [voice state](/developers/resources/voice#voice-state-object) objects                             | States of members currently in voice channels; lacks the `guild_id` key                                                    |
| members                  | array of [guild member](/developers/resources/guild#guild-member-object) objects                                   | Users in the guild                                                                                                         |
| channels                 | array of [channel](/developers/resources/channel#channel-object) objects                                           | Channels in the guild                                                                                                      |
| threads                  | array of [channel](/developers/resources/channel#channel-object) objects                                           | All active threads in the guild that current user has permission to view                                                   |
| presences                | array of partial [presence update](/developers/events/gateway-events#presence-update) objects                      | Presences of the members in the guild, will only include non-offline members if the size is greater than `large threshold` |
| stage\_instances         | array of [stage instance](/developers/resources/stage-instance#stage-instance-object) objects                      | Stage instances in the guild                                                                                               |
| guild\_scheduled\_events | array of [guild scheduled event](/developers/resources/guild-scheduled-event#guild-scheduled-event-object) objects | Scheduled events in the guild                                                                                              |
| soundboard\_sounds       | array of [soundboard sound](/developers/resources/soundboard#soundboard-sound-object) objects                      | Soundboard sounds in the guild                                                                                             |

<Warning>
  If your bot does not have the `GUILD_PRESENCES` [Gateway Intent](/developers/events/gateway#gateway-intents), or if the guild has over 75k members, members and presences returned in this event will only contain your bot and users in voice channels.
</Warning>

#### Guild Update

Sent when a guild is updated. The inner payload is a [guild](/developers/resources/guild#guild-object) object.

#### Guild Delete

Sent when a guild becomes or was already unavailable due to an outage, or when the user leaves or is removed from a guild. The inner payload is an [unavailable guild](/developers/resources/guild#unavailable-guild-object) object. If the `unavailable` field is not set, the user was removed from the guild.

#### Guild Audit Log Entry Create

Sent when a guild audit log entry is created. The inner payload is an [Audit Log Entry](/developers/resources/audit-log#audit-log-entry-object) object with an extra `guild_id` key. This event is only sent to bots with the `VIEW_AUDIT_LOG` permission.

<ManualAnchor id="guild-audit-log-entry-create-guild-audit-log-entry-create-event-extra-fields" />

###### Guild Audit Log Entry Create Event Extra Fields

| Field     | Type      | Description     |
| --------- | --------- | --------------- |
| guild\_id | snowflake | ID of the guild |

#### Guild Ban Add

Sent when a user is banned from a guild. This event is only sent to bots with the `BAN_MEMBERS` or `VIEW_AUDIT_LOG` permission.

<ManualAnchor id="guild-ban-add-guild-ban-add-event-fields" />

###### Guild Ban Add Event Fields

| Field     | Type                                                    | Description         |
| --------- | ------------------------------------------------------- | ------------------- |
| guild\_id | snowflake                                               | ID of the guild     |
| user      | a [user](/developers/resources/user#user-object) object | User who was banned |

#### Guild Ban Remove

Sent when a user is unbanned from a guild. This event is only sent to bots with the `BAN_MEMBERS` or `VIEW_AUDIT_LOG` permission.

<ManualAnchor id="guild-ban-remove-guild-ban-remove-event-fields" />

###### Guild Ban Remove Event Fields

| Field     | Type                                                    | Description           |
| --------- | ------------------------------------------------------- | --------------------- |
| guild\_id | snowflake                                               | ID of the guild       |
| user      | a [user](/developers/resources/user#user-object) object | User who was unbanned |

#### Guild Emojis Update

Sent when a guild's emojis have been updated.

<ManualAnchor id="guild-emojis-update-guild-emojis-update-event-fields" />

###### Guild Emojis Update Event Fields

| Field     | Type      | Description                                                 |
| --------- | --------- | ----------------------------------------------------------- |
| guild\_id | snowflake | ID of the guild                                             |
| emojis    | array     | Array of [emojis](/developers/resources/emoji#emoji-object) |

#### Guild Stickers Update

Sent when a guild's stickers have been updated.

<ManualAnchor id="guild-stickers-update-guild-stickers-update-event-fields" />

###### Guild Stickers Update Event Fields

| Field     | Type      | Description                                                       |
| --------- | --------- | ----------------------------------------------------------------- |
| guild\_id | snowflake | ID of the guild                                                   |
| stickers  | array     | Array of [stickers](/developers/resources/sticker#sticker-object) |

#### Guild Integrations Update

Sent when a guild integration is updated.

<ManualAnchor id="guild-integrations-update-guild-integrations-update-event-fields" />

###### Guild Integrations Update Event Fields

| Field     | Type      | Description                                     |
| --------- | --------- | ----------------------------------------------- |
| guild\_id | snowflake | ID of the guild whose integrations were updated |

#### Guild Member Add

<Warning>
  If using [Gateway Intents](/developers/events/gateway#gateway-intents), the `GUILD_MEMBERS` intent will be required to receive this event.
</Warning>

Sent when a user joins a guild. This event may also be sent for users who are already members of the guild. The inner payload is a [guild member](/developers/resources/guild#guild-member-object) object with an extra `guild_id` key:

<ManualAnchor id="guild-member-add-guild-member-add-extra-fields" />

###### Guild Member Add Extra Fields

| Field     | Type      | Description     |
| --------- | --------- | --------------- |
| guild\_id | snowflake | ID of the guild |

#### Guild Member Remove

<Warning>
  If using [Gateway Intents](/developers/events/gateway#gateway-intents), the `GUILD_MEMBERS` intent will be required to receive this event.
</Warning>

Sent when a user is removed from a guild (leave/kick/ban).

<ManualAnchor id="guild-member-remove-guild-member-remove-event-fields" />

###### Guild Member Remove Event Fields

| Field     | Type                                                    | Description          |
| --------- | ------------------------------------------------------- | -------------------- |
| guild\_id | snowflake                                               | ID of the guild      |
| user      | a [user](/developers/resources/user#user-object) object | User who was removed |

#### Guild Member Update

<Warning>
  If using [Gateway Intents](/developers/events/gateway#gateway-intents), the `GUILD_MEMBERS` intent will be required to receive this event.
</Warning>

Sent when a guild member is updated. This will also fire when the user object of a guild member changes.

<ManualAnchor id="guild-member-update-guild-member-update-event-fields" />

###### Guild Member Update Event Fields

| Field                           | Type                                                                                | Description                                                                                                                                                                                                                          |
| ------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| guild\_id                       | snowflake                                                                           | ID of the guild                                                                                                                                                                                                                      |
| roles                           | array of snowflakes                                                                 | User role ids                                                                                                                                                                                                                        |
| user                            | a [user](/developers/resources/user#user-object) object                             | User                                                                                                                                                                                                                                 |
| nick?                           | ?string                                                                             | Nickname of the user in the guild                                                                                                                                                                                                    |
| avatar                          | ?string                                                                             | Member's [guild avatar hash](/developers/reference#image-formatting)                                                                                                                                                                 |
| banner                          | ?string                                                                             | Member's [guild banner hash](/developers/reference#image-formatting)                                                                                                                                                                 |
| joined\_at                      | ?ISO8601 timestamp                                                                  | When the user joined the guild                                                                                                                                                                                                       |
| premium\_since?                 | ?ISO8601 timestamp                                                                  | When the user starting [boosting](https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-) the guild                                                                                                             |
| deaf?                           | boolean                                                                             | Whether the user is deafened in voice channels                                                                                                                                                                                       |
| mute?                           | boolean                                                                             | Whether the user is muted in voice channels                                                                                                                                                                                          |
| pending?                        | boolean                                                                             | Whether the user has not yet passed the guild's [Membership Screening](/developers/resources/guild#membership-screening-object) requirements                                                                                         |
| communication\_disabled\_until? | ?ISO8601 timestamp                                                                  | When the user's [timeout](https://support.discord.com/hc/en-us/articles/4413305239191-Time-Out-FAQ) will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out |
| avatar\_decoration\_data?       | ?[avatar decoration data](/developers/resources/user#avatar-decoration-data-object) | Data for the member's guild avatar decoration                                                                                                                                                                                        |
| collectibles?                   | ?[collectibles](/developers/resources/user#collectibles) object                     | data for the member's collectibles                                                                                                                                                                                                   |

#### Guild Members Chunk

Sent in response to [Guild Request Members](/developers/events/gateway-events#request-guild-members).
You can use the `chunk_index` and `chunk_count` to calculate how many chunks are left for your request.

<ManualAnchor id="guild-members-chunk-guild-members-chunk-event-fields" />

###### Guild Members Chunk Event Fields

| Field        | Type                                                                             | Description                                                                                        |
| ------------ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| guild\_id    | snowflake                                                                        | ID of the guild                                                                                    |
| members      | array of [guild member](/developers/resources/guild#guild-member-object) objects | Set of guild members                                                                               |
| chunk\_index | integer                                                                          | Chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`)            |
| chunk\_count | integer                                                                          | Total number of expected chunks for this response                                                  |
| not\_found?  | array                                                                            | When passing an invalid ID to `REQUEST_GUILD_MEMBERS`, it will be returned here                    |
| presences?   | array of [presence](/developers/events/gateway-events#presence) objects          | When passing `true` to `REQUEST_GUILD_MEMBERS`, presences of the returned members will be here     |
| nonce?       | string                                                                           | Nonce used in the [Guild Members Request](/developers/events/gateway-events#request-guild-members) |

#### Guild Role Create

Sent when a guild role is created.

<ManualAnchor id="guild-role-create-guild-role-create-event-fields" />

###### Guild Role Create Event Fields

| Field     | Type                                                        | Description           |
| --------- | ----------------------------------------------------------- | --------------------- |
| guild\_id | snowflake                                                   | ID of the guild       |
| role      | a [role](/developers/topics/permissions#role-object) object | Role that was created |

#### Guild Role Update

Sent when a guild role is updated.

<ManualAnchor id="guild-role-update-guild-role-update-event-fields" />

###### Guild Role Update Event Fields

| Field     | Type                                                        | Description           |
| --------- | ----------------------------------------------------------- | --------------------- |
| guild\_id | snowflake                                                   | ID of the guild       |
| role      | a [role](/developers/topics/permissions#role-object) object | Role that was updated |

#### Guild Role Delete

Sent when a guild role is deleted.

<ManualAnchor id="guild-role-delete-guild-role-delete-event-fields" />

###### Guild Role Delete Event Fields

| Field     | Type      | Description     |
| --------- | --------- | --------------- |
| guild\_id | snowflake | ID of the guild |
| role\_id  | snowflake | ID of the role  |

#### Guild Scheduled Event Create

Sent when a guild scheduled event is created. The inner payload is a [guild scheduled event](/developers/resources/guild-scheduled-event#guild-scheduled-event-object) object.

#### Guild Scheduled Event Update

Sent when a guild scheduled event is updated. The inner payload is a [guild scheduled event](/developers/resources/guild-scheduled-event#guild-scheduled-event-object) object.

#### Guild Scheduled Event Delete

Sent when a guild scheduled event is deleted. The inner payload is a [guild scheduled event](/developers/resources/guild-scheduled-event#guild-scheduled-event-object) object.

#### Guild Scheduled Event User Add

Sent when a user has subscribed to a guild scheduled event.

<ManualAnchor id="guild-scheduled-event-user-add-guild-scheduled-event-user-add-event-fields" />

###### Guild Scheduled Event User Add Event Fields

| Field                       | Type      | Description                     |
| --------------------------- | --------- | ------------------------------- |
| guild\_scheduled\_event\_id | snowflake | ID of the guild scheduled event |
| user\_id                    | snowflake | ID of the user                  |
| guild\_id                   | snowflake | ID of the guild                 |

#### Guild Scheduled Event User Remove

Sent when a user has unsubscribed from a guild scheduled event.

<ManualAnchor id="guild-scheduled-event-user-remove-guild-scheduled-event-user-remove-event-fields" />

###### Guild Scheduled Event User Remove Event Fields

| Field                       | Type      | Description                     |
| --------------------------- | --------- | ------------------------------- |
| guild\_scheduled\_event\_id | snowflake | ID of the guild scheduled event |
| user\_id                    | snowflake | ID of the user                  |
| guild\_id                   | snowflake | ID of the guild                 |

#### Guild Soundboard Sound Create

Sent when a guild soundboard sound is created. The inner payload is a [soundboard sound](/developers/resources/soundboard#soundboard-sound-object) object.

#### Guild Soundboard Sound Update

Sent when a guild soundboard sound is updated. The inner payload is a [soundboard sound](/developers/resources/soundboard#soundboard-sound-object) object.

#### Guild Soundboard Sound Delete

Sent when a guild soundboard sound is deleted.

<ManualAnchor id="guild-soundboard-sound-delete-guild-soundboard-sound-delete-event-fields" />

###### Guild Soundboard Sound Delete Event Fields

| Field     | Type      | Description                      |
| --------- | --------- | -------------------------------- |
| sound\_id | snowflake | ID of the sound that was deleted |
| guild\_id | snowflake | ID of the guild the sound was in |

#### Guild Soundboard Sounds Update

Sent when multiple guild soundboard sounds are updated.

<ManualAnchor id="guild-soundboard-sounds-update-guild-soundboard-sounds-update-event-fields" />

###### Guild Soundboard Sounds Update Event Fields

| Field              | Type                                                                                          | Description                   |
| ------------------ | --------------------------------------------------------------------------------------------- | ----------------------------- |
| soundboard\_sounds | array of [soundboard sound](/developers/resources/soundboard#soundboard-sound-object) objects | The guild's soundboard sounds |
| guild\_id          | snowflake                                                                                     | ID of the guild               |

#### Soundboard Sounds

Includes a guild's list of soundboard sounds. Sent in response to [Request Soundboard Sounds](/developers/events/gateway-events#request-soundboard-sounds).

<ManualAnchor id="soundboard-sounds-soundboard-sounds-event-fields" />

###### Soundboard Sounds Event Fields

| Field              | Type                                                                                          | Description                   |
| ------------------ | --------------------------------------------------------------------------------------------- | ----------------------------- |
| soundboard\_sounds | array of [soundboard sound](/developers/resources/soundboard#soundboard-sound-object) objects | The guild's soundboard sounds |
| guild\_id          | snowflake                                                                                     | ID of the guild               |

### Integrations

#### Integration Create

Sent when an integration is created. The inner payload is an [integration](/developers/resources/guild#integration-object) object with `user` omitted and an additional `guild_id` key:

<ManualAnchor id="integration-create-integration-create-event-additional-fields" />

###### Integration Create Event Additional Fields

| Field     | Type      | Description     |
| --------- | --------- | --------------- |
| guild\_id | snowflake | ID of the guild |

#### Integration Update

Sent when an integration is updated. The inner payload is an [integration](/developers/resources/guild#integration-object) object with `user` omitted and an additional `guild_id` key:

<ManualAnchor id="integration-update-integration-update-event-additional-fields" />

###### Integration Update Event Additional Fields

| Field     | Type      | Description     |
| --------- | --------- | --------------- |
| guild\_id | snowflake | ID of the guild |

#### Integration Delete

Sent when an integration is deleted.

<ManualAnchor id="integration-delete-integration-delete-event-fields" />

###### Integration Delete Event Fields

| Field            | Type      | Description                                                   |
| ---------------- | --------- | ------------------------------------------------------------- |
| id               | snowflake | Integration ID                                                |
| guild\_id        | snowflake | ID of the guild                                               |
| application\_id? | snowflake | ID of the bot/OAuth2 application for this discord integration |

### Invites

All [Invite](/developers/resources/invite) related events are only sent to bot users with the `MANAGE_CHANNELS` permission on the channel.

#### Invite Create

Sent when a new invite to a channel is created.

<ManualAnchor id="invite-create-invite-create-event-fields" />

###### Invite Create Event Fields

| Field                | Type                                                                               | Description                                                                                                                    |
| -------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| channel\_id          | snowflake                                                                          | Channel the invite is for                                                                                                      |
| code                 | string                                                                             | Unique invite [code](/developers/resources/invite#invite-object)                                                               |
| created\_at          | ISO8601 timestamp                                                                  | Time at which the invite was created                                                                                           |
| guild\_id?           | snowflake                                                                          | Guild of the invite                                                                                                            |
| inviter?             | [user](/developers/resources/user#user-object) object                              | User that created the invite                                                                                                   |
| max\_age             | integer                                                                            | How long the invite is valid for (in seconds)                                                                                  |
| max\_uses            | integer                                                                            | Maximum number of times the invite can be used                                                                                 |
| target\_type?        | integer                                                                            | [Type of target](/developers/resources/invite#invite-object-invite-target-types) for this voice channel invite                 |
| target\_user?        | [user](/developers/resources/user#user-object) object                              | User whose stream to display for this voice channel stream invite                                                              |
| target\_application? | partial [application](/developers/resources/application#application-object) object | Embedded application to open for this voice channel embedded application invite                                                |
| temporary            | boolean                                                                            | Whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role)             |
| uses                 | integer                                                                            | How many times the invite has been used (always will be 0)                                                                     |
| expires\_at          | ?ISO8601 timestamp                                                                 | the expiration date of this invite                                                                                             |
| role\_ids?           | array of snowflakes                                                                | the role ID(s) for [roles](/developers/topics/permissions#role-object) in the guild given to the users that accept this invite |

#### Invite Delete

Sent when an invite is deleted.

<ManualAnchor id="invite-delete-invite-delete-event-fields" />

###### Invite Delete Event Fields

| Field       | Type      | Description                                                      |
| ----------- | --------- | ---------------------------------------------------------------- |
| channel\_id | snowflake | Channel of the invite                                            |
| guild\_id?  | snowflake | Guild of the invite                                              |
| code        | string    | Unique invite [code](/developers/resources/invite#invite-object) |

### Messages

<Warning>
  Unlike persistent messages, ephemeral messages are sent directly to the user and the bot who sent the message rather than through the guild channel. Because of this, ephemeral messages are tied to the [`DIRECT_MESSAGES` intent](/developers/events/gateway#list-of-intents), and the message object won't include `guild_id` or `member`.
</Warning>

#### Message Create

Sent when a message is created. The inner payload is a [message](/developers/resources/message#message-object) object with the following extra fields:

<ManualAnchor id="message-create-message-create-extra-fields" />

###### Message Create Extra Fields

| Field          | Type                                                                                                                                                                   | Description                                                                                               |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| guild\_id?     | snowflake                                                                                                                                                              | ID of the guild the message was sent in - unless it is an ephemeral message                               |
| member?        | partial [guild member](/developers/resources/guild#guild-member-object) object                                                                                         | Member properties for this message's author. Missing for ephemeral messages and messages from webhooks    |
| mentions       | array of [user](/developers/resources/user#user-object) objects, optionally with an additional partial [member](/developers/resources/guild#guild-member-object) field | Users specifically mentioned in the message                                                               |
| channel\_type? | integer                                                                                                                                                                | The [type of channel](/developers/resources/channel#channel-object-channel-types) the message was sent in |

#### Message Update

Sent when a message is updated. The inner payload is a [message](/developers/resources/message#message-object) object with the same extra fields as [MESSAGE\_CREATE](/developers/events/gateway-events#message-create).

<Warning>
  The value for `tts` will always be false in message updates.
</Warning>

#### Message Delete

Sent when a message is deleted.

<ManualAnchor id="message-delete-message-delete-event-fields" />

###### Message Delete Event Fields

| Field       | Type      | Description       |
| ----------- | --------- | ----------------- |
| id          | snowflake | ID of the message |
| channel\_id | snowflake | ID of the channel |
| guild\_id?  | snowflake | ID of the guild   |

#### Message Delete Bulk

Sent when multiple messages are deleted at once.

<ManualAnchor id="message-delete-bulk-message-delete-bulk-event-fields" />

###### Message Delete Bulk Event Fields

| Field       | Type                | Description         |
| ----------- | ------------------- | ------------------- |
| ids         | array of snowflakes | IDs of the messages |
| channel\_id | snowflake           | ID of the channel   |
| guild\_id?  | snowflake           | ID of the guild     |

#### Message Reaction Add

Sent when a user adds a reaction to a message.

<ManualAnchor id="message-reaction-add-message-reaction-add-event-fields" />

###### Message Reaction Add Event Fields

| Field                | Type                                                               | Description                                                                                      |
| -------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| user\_id             | snowflake                                                          | ID of the user                                                                                   |
| channel\_id          | snowflake                                                          | ID of the channel                                                                                |
| message\_id          | snowflake                                                          | ID of the message                                                                                |
| guild\_id?           | snowflake                                                          | ID of the guild                                                                                  |
| member?              | [member](/developers/resources/guild#guild-member-object) object   | Member who reacted if this happened in a guild                                                   |
| emoji                | a partial [emoji](/developers/resources/emoji#emoji-object) object | Emoji used to react - [example](/developers/resources/emoji#emoji-object-standard-emoji-example) |
| message\_author\_id? | snowflake                                                          | ID of the user who authored the message which was reacted to                                     |
| burst                | boolean                                                            | true if this is a super-reaction                                                                 |
| burst\_colors?       | array of strings                                                   | Colors used for super-reaction animation in "#rrggbb" format                                     |
| type                 | integer                                                            | The [type of reaction](/developers/resources/message#get-reactions-reaction-types)               |

#### Message Reaction Remove

Sent when a user removes a reaction from a message.

<ManualAnchor id="message-reaction-remove-message-reaction-remove-event-fields" />

###### Message Reaction Remove Event Fields

| Field       | Type                                                               | Description                                                                                      |
| ----------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| user\_id    | snowflake                                                          | ID of the user                                                                                   |
| channel\_id | snowflake                                                          | ID of the channel                                                                                |
| message\_id | snowflake                                                          | ID of the message                                                                                |
| guild\_id?  | snowflake                                                          | ID of the guild                                                                                  |
| emoji       | a partial [emoji](/developers/resources/emoji#emoji-object) object | Emoji used to react - [example](/developers/resources/emoji#emoji-object-standard-emoji-example) |
| burst       | boolean                                                            | true if this was a super-reaction                                                                |
| type        | integer                                                            | The [type of reaction](/developers/resources/message#get-reactions-reaction-types)               |

#### Message Reaction Remove All

Sent when a user explicitly removes all reactions from a message.

<ManualAnchor id="message-reaction-remove-all-message-reaction-remove-all-event-fields" />

###### Message Reaction Remove All Event Fields

| Field       | Type      | Description       |
| ----------- | --------- | ----------------- |
| channel\_id | snowflake | ID of the channel |
| message\_id | snowflake | ID of the message |
| guild\_id?  | snowflake | ID of the guild   |

#### Message Reaction Remove Emoji

Sent when a bot removes all instances of a given emoji from the reactions of a message.

<ManualAnchor id="message-reaction-remove-emoji-message-reaction-remove-emoji-event-fields" />

###### Message Reaction Remove Emoji Event Fields

| Field       | Type                                                             | Description            |
| ----------- | ---------------------------------------------------------------- | ---------------------- |
| channel\_id | snowflake                                                        | ID of the channel      |
| guild\_id?  | snowflake                                                        | ID of the guild        |
| message\_id | snowflake                                                        | ID of the message      |
| emoji       | [partial emoji object](/developers/resources/emoji#emoji-object) | Emoji that was removed |

### Presence

#### Presence Update

<Warning>
  If you are using [Gateway Intents](/developers/events/gateway#gateway-intents), you *must* specify the `GUILD_PRESENCES` intent in order to receive Presence Update events
</Warning>

A user's presence is their current state on a guild. This event is sent when a user's presence or info, such as name or avatar, is updated.

<Warning>
  The user object within this event can be partial, the only field which must be sent is the `id` field, everything else is optional. Along with this limitation, no fields are required, and the types of the fields are **not** validated. Your client should expect any combination of fields and types within this event.
</Warning>

<ManualAnchor id="presence-update-presence-update-event-fields" />

###### Presence Update Event Fields

| Field          | Type                                                                            | Description                                  |
| -------------- | ------------------------------------------------------------------------------- | -------------------------------------------- |
| user           | [user](/developers/resources/user#user-object) object                           | User whose presence is being updated         |
| guild\_id      | snowflake                                                                       | ID of the guild                              |
| status         | string                                                                          | Either "idle", "dnd", "online", or "offline" |
| activities     | array of [activity](/developers/events/gateway-events#activity-object) objects  | User's current activities                    |
| client\_status | [client\_status](/developers/events/gateway-events#client-status-object) object | User's platform-dependent status             |

#### Client Status Object

Active sessions are indicated with an "online", "idle", or "dnd" string per platform. If a user is offline or invisible, the corresponding field is not present.

| Field    | Type   | Description                                                                       |
| -------- | ------ | --------------------------------------------------------------------------------- |
| desktop? | string | User's status set for an active desktop (Windows, Linux, Mac) application session |
| mobile?  | string | User's status set for an active mobile (iOS, Android) application session         |
| web?     | string | User's status set for an active web (browser, bot user) application session       |

#### Activity Object

<ManualAnchor id="activity-object-activity-structure" />

###### Activity Structure

| Field                  | Type                                                                                       | Description                                                                                                                                                                   |
| ---------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                   | string                                                                                     | Activity's name                                                                                                                                                               |
| type                   | integer                                                                                    | [Activity type](/developers/events/gateway-events#activity-object-activity-types)                                                                                             |
| url?                   | ?string                                                                                    | Stream URL, is validated when type is 1                                                                                                                                       |
| created\_at            | integer                                                                                    | Unix timestamp (in milliseconds) of when the activity was added to the user's session                                                                                         |
| timestamps?            | [timestamps](/developers/events/gateway-events#activity-object-activity-timestamps) object | Unix timestamps for start and/or end of the game                                                                                                                              |
| application\_id?       | snowflake                                                                                  | Application ID for the game                                                                                                                                                   |
| status\_display\_type? | ?integer                                                                                   | [Status display type](/developers/events/gateway-events#activity-object-status-display-types); controls which field is displayed in the user's status text in the member list |
| details?               | ?string                                                                                    | What the player is currently doing                                                                                                                                            |
| details\_url?          | ?string                                                                                    | URL that is linked when clicking on the details text                                                                                                                          |
| state?                 | ?string                                                                                    | User's current party status, or text used for a custom status                                                                                                                 |
| state\_url?            | ?string                                                                                    | URL that is linked when clicking on the state text                                                                                                                            |
| emoji?                 | ?[emoji](/developers/events/gateway-events#activity-object-activity-emoji) object          | Emoji used for a custom status                                                                                                                                                |
| party?                 | [party](/developers/events/gateway-events#activity-object-activity-party) object           | Information for the current party of the player                                                                                                                               |
| assets?                | [assets](/developers/events/gateway-events#activity-object-activity-assets) object         | Images for the presence and their hover texts                                                                                                                                 |
| secrets?               | [secrets](/developers/events/gateway-events#activity-object-activity-secrets) object       | Secrets for Rich Presence joining and spectating                                                                                                                              |
| instance?              | boolean                                                                                    | Whether or not the activity is an instanced game session                                                                                                                      |
| flags?                 | integer                                                                                    | [Activity flags](/developers/events/gateway-events#activity-object-activity-flags) `OR`d together, describes what the payload includes                                        |
| buttons?               | array of [buttons](/developers/events/gateway-events#activity-object-activity-buttons)     | Custom buttons shown in the Rich Presence (max 2)                                                                                                                             |

<Info>
  Bot users are only able to set `name`, `state`, `type`, and `url`.
</Info>

<ManualAnchor id="activity-object-activity-types" />

###### Activity Types

| ID | Name      | Format                | Example                              |
| -- | --------- | --------------------- | ------------------------------------ |
| 0  | Playing   | Playing `{name}`      | "Playing Rocket League"              |
| 1  | Streaming | Streaming `{details}` | "Streaming Rocket League"            |
| 2  | Listening | Listening to `{name}` | "Listening to Spotify"               |
| 3  | Watching  | Watching `{name}`     | "Watching YouTube Together"          |
| 4  | Custom    | `{emoji}` `{state}`   | ":smiley: I am cool"                 |
| 5  | Competing | Competing in `{name}` | "Competing in Arena World Champions" |

<Info>
  The streaming type currently only supports Twitch and YouTube. Only `https://twitch.tv/` and `https://youtube.com/` urls will work.
</Info>

<ManualAnchor id="activity-object-status-display-types" />

###### Status Display Types

| ID | Name    | Example                                |
| -- | ------- | -------------------------------------- |
| 0  | Name    | "Listening to Spotify"                 |
| 1  | State   | "Listening to Rick Astley"             |
| 2  | Details | "Listening to Never Gonna Give You Up" |

<Info>
  This applies to all activity types. "Listening" was used to serve as a consistent example of what the different fields might be used for.
</Info>

<ManualAnchor id="activity-object-activity-timestamps" />

###### Activity Timestamps

| Field  | Type    | Description                                              |
| ------ | ------- | -------------------------------------------------------- |
| start? | integer | Unix time (in milliseconds) of when the activity started |
| end?   | integer | Unix time (in milliseconds) of when the activity ends    |

<Info>
  For Listening and Watching activities, you can include both start and end timestamps to display a time bar.
</Info>

<ManualAnchor id="activity-object-activity-emoji" />

###### Activity Emoji

| Field     | Type      | Description                   |
| --------- | --------- | ----------------------------- |
| name      | string    | Name of the emoji             |
| id?       | snowflake | ID of the emoji               |
| animated? | boolean   | Whether the emoji is animated |

<ManualAnchor id="activity-object-activity-party" />

###### Activity Party

| Field | Type                                             | Description                                       |
| ----- | ------------------------------------------------ | ------------------------------------------------- |
| id?   | string                                           | ID of the party                                   |
| size? | array of two integers (current\_size, max\_size) | Used to show the party's current and maximum size |

<ManualAnchor id="activity-object-activity-assets" />

###### Activity Assets

| Field                 | Type   | Description                                                                                                                                                                                                            |
| --------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| large\_image?         | string | See [Activity Asset Image](/developers/events/gateway-events#activity-object-activity-asset-image)                                                                                                                     |
| large\_text?          | string | Text displayed when hovering over the large image of the activity                                                                                                                                                      |
| large\_url?           | string | URL that is opened when clicking on the large image                                                                                                                                                                    |
| small\_image?         | string | See [Activity Asset Image](/developers/events/gateway-events#activity-object-activity-asset-image)                                                                                                                     |
| small\_text?          | string | Text displayed when hovering over the small image of the activity                                                                                                                                                      |
| small\_url?           | string | URL that is opened when clicking on the small image                                                                                                                                                                    |
| invite\_cover\_image? | string | See [Activity Asset Image](/developers/events/gateway-events#activity-object-activity-asset-image). Displayed as a banner on a [Game Invite](/developers/discord-social-sdk/development-guides/managing-game-invites). |

<ManualAnchor id="activity-object-activity-asset-image" />

###### Activity Asset Image

Activity asset images are arbitrary strings which usually contain snowflake IDs or prefixed image IDs. Treat data within this field carefully, as it is user-specifiable and not sanitized.

To use an external image via media proxy, specify the URL as the field's value when sending. You will only receive the `mp:` prefix via the gateway.

| Type              | Format                   | Image URL                                                                        |
| ----------------- | ------------------------ | -------------------------------------------------------------------------------- |
| Application Asset | `{application_asset_id}` | See [Application Asset Image Formatting](/developers/reference#image-formatting) |
| Media Proxy Image | `mp:{image_id}`          | `https://media.discordapp.net/{image_id}`                                        |

<Info>
  **Uploaded assets** (Application Asset type) support PNG, JPEG, and WebP. Animated images are not supported for uploaded assets.

  **External URL assets** (Media Proxy Image type) support any publicly accessible image URL, including GIF, animated WebP, and AVIF.
</Info>

<ManualAnchor id="activity-object-activity-secrets" />

###### Activity Secrets

| Field     | Type   | Description                           |
| --------- | ------ | ------------------------------------- |
| join?     | string | Secret for joining a party            |
| spectate? | string | Secret for spectating a game          |
| match?    | string | Secret for a specific instanced match |

<ManualAnchor id="activity-object-activity-flags" />

###### Activity Flags

| Name                           | Value    |
| ------------------------------ | -------- |
| INSTANCE                       | `1 << 0` |
| JOIN                           | `1 << 1` |
| SPECTATE                       | `1 << 2` |
| JOIN\_REQUEST                  | `1 << 3` |
| SYNC                           | `1 << 4` |
| PLAY                           | `1 << 5` |
| PARTY\_PRIVACY\_FRIENDS        | `1 << 6` |
| PARTY\_PRIVACY\_VOICE\_CHANNEL | `1 << 7` |
| EMBEDDED                       | `1 << 8` |

<ManualAnchor id="activity-object-activity-buttons" />

###### Activity Buttons

When received over the gateway, the `buttons` field is an array of strings, which are the button labels. Bots cannot access a user's activity button URLs. When sending, the `buttons` field must be an array of the below object:

| Field | Type   | Description                                            |
| ----- | ------ | ------------------------------------------------------ |
| label | string | Text shown on the button (1-32 characters)             |
| url   | string | URL opened when clicking the button (1-512 characters) |

<ManualAnchor id="activity-object-example-activity" />

###### Example Activity

```json theme={"system"}
{
  "details": "24H RL Stream for Charity",
  "state": "Rocket League",
  "name": "Twitch",
  "type": 1,
  "url": "https://www.twitch.tv/discord"
}
```

<ManualAnchor id="activity-object-example-activity-with-rich-presence" />

###### Example Activity with Rich Presence

```json theme={"system"}
{
  "name": "Rocket League",
  "type": 0,
  "application_id": "379286085710381999",
  "state": "In a Match",
  "details": "Ranked Duos: 2-1",
  "timestamps": {
    "start": 15112000660000
  },
  "party": {
    "id": "9dd6594e-81b3-49f6-a6b5-a679e6a060d3",
    "size": [2, 2]
  },
  "assets": {
    "large_image": "351371005538729000",
    "large_text": "DFH Stadium",
    "small_image": "351371005538729111",
    "small_text": "Silver III"
  },
  "secrets": {
    "join": "025ed05c71f639de8bfaa0d679d7c94b2fdce12f",
    "spectate": "e7eb30d2ee025ed05c71ea495f770b76454ee4e0",
    "match": "4b2fdce12f639de8bfa7e3591b71a0d679d7c93f"
  }
}
```

<Warning>
  Clients may only update their game status 5 times per 20 seconds.
</Warning>

#### Typing Start

Sent when a user starts typing in a channel.

<ManualAnchor id="typing-start-typing-start-event-fields" />

###### Typing Start Event Fields

| Field       | Type                                                             | Description                                            |
| ----------- | ---------------------------------------------------------------- | ------------------------------------------------------ |
| channel\_id | snowflake                                                        | ID of the channel                                      |
| guild\_id?  | snowflake                                                        | ID of the guild                                        |
| user\_id    | snowflake                                                        | ID of the user                                         |
| timestamp   | integer                                                          | Unix time (in seconds) of when the user started typing |
| member?     | [member](/developers/resources/guild#guild-member-object) object | Member who started typing if this happened in a guild  |

#### User Update

Sent when properties about the current bot's user change. Inner payload is a [user](/developers/resources/user#user-object) object.

### Voice

#### Voice Channel Effect Send

Sent when someone sends an effect, such as an emoji reaction or a soundboard sound, in a voice channel the current user is connected to.

<ManualAnchor id="voice-channel-effect-send-voice-channel-effect-send-event-fields" />

###### Voice Channel Effect Send Event Fields

| Field            | Type                                                      | Description                                                                                                                                           |
| ---------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| channel\_id      | snowflake                                                 | ID of the channel the effect was sent in                                                                                                              |
| guild\_id        | snowflake                                                 | ID of the guild the effect was sent in                                                                                                                |
| user\_id         | snowflake                                                 | ID of the user who sent the effect                                                                                                                    |
| emoji?           | ?[emoji](/developers/resources/emoji#emoji-object) object | The emoji sent, for emoji reaction and soundboard effects                                                                                             |
| animation\_type? | ?integer                                                  | The [type of emoji animation](/developers/events/gateway-events#voice-channel-effect-send-animation-types), for emoji reaction and soundboard effects |
| animation\_id?   | integer                                                   | The ID of the emoji animation, for emoji reaction and soundboard effects                                                                              |
| sound\_id?       | snowflake or integer                                      | The ID of the soundboard sound, for soundboard effects                                                                                                |
| sound\_volume?   | double                                                    | The volume of the soundboard sound, from 0 to 1, for soundboard effects                                                                               |

<ManualAnchor id="voice-channel-effect-send-animation-types" />

###### Animation Types

| Type    | Value | Description                                 |
| ------- | ----- | ------------------------------------------- |
| PREMIUM | 0     | A fun animation, sent by a Nitro subscriber |
| BASIC   | 1     | The standard animation                      |

#### Voice State Update

Sent when someone joins/leaves/moves voice channels. Inner payload is a [voice state](/developers/resources/voice#voice-state-object) object.

#### Voice Server Update

Sent when a guild's voice server is updated. This is sent when initially connecting to voice, and when the current voice instance fails over to a new server.

<Warning>
  A null endpoint means that the voice server allocated has gone away and is trying to be reallocated. You should attempt to disconnect from the currently connected voice server, and not attempt to reconnect until a new voice server is allocated.
</Warning>

<ManualAnchor id="voice-server-update-voice-server-update-event-fields" />

###### Voice Server Update Event Fields

| Field     | Type      | Description                           |
| --------- | --------- | ------------------------------------- |
| token     | string    | Voice connection token                |
| guild\_id | snowflake | Guild this voice server update is for |
| endpoint  | ?string   | Voice server host                     |

<ManualAnchor id="voice-server-update-example-voice-server-update-payload" />

###### Example Voice Server Update Payload

```json theme={"system"}
{
  "token": "my_token",
  "guild_id": "41771983423143937",
  "endpoint": "sweetwater-12345.discord.media:2048"
}
```

### Webhooks

#### Webhooks Update

Sent when a guild channel's webhook is created, updated, or deleted.

<ManualAnchor id="webhooks-update-webhooks-update-event-fields" />

###### Webhooks Update Event Fields

| Field       | Type      | Description       |
| ----------- | --------- | ----------------- |
| guild\_id   | snowflake | ID of the guild   |
| channel\_id | snowflake | ID of the channel |

### Interactions

#### Interaction Create

Sent when a user uses an [Application Command](/developers/interactions/application-commands) or [Message Component](/developers/components/reference#component-object). Inner payload is an [Interaction](/developers/interactions/receiving-and-responding#interaction-object-interaction-structure).

### Stage Instances

#### Stage Instance Create

Sent when a [Stage instance](/developers/resources/stage-instance) is created (i.e. the Stage is now "live"). Inner payload is a [Stage instance](/developers/resources/stage-instance#stage-instance-object)

#### Stage Instance Update

Sent when a [Stage instance](/developers/resources/stage-instance) has been updated. Inner payload is a [Stage instance](/developers/resources/stage-instance#stage-instance-object)

#### Stage Instance Delete

Sent when a [Stage instance](/developers/resources/stage-instance) has been deleted (i.e. the Stage has been closed). Inner payload is a [Stage instance](/developers/resources/stage-instance#stage-instance-object)

### Subscriptions

#### Subscription Create

<Info>
  Subscription status should not be used to grant perks. Use [entitlements](/developers/resources/entitlement#entitlement-object) as an indication of whether a user should have access to a specific SKU. See our guide on [Implementing App Subscriptions](/developers/monetization/implementing-app-subscriptions) for more information.
</Info>

Sent when a [Subscription](/developers/resources/subscription) for a Premium App is created. Inner payload is a [Subscription](/developers/resources/subscription#subscription-object).

A Subscription's `status` can be either **inactive** or **active** when this event is received. You will receive subsequent `SUBSCRIPTION_UPDATE` events if the `status` is updated to **active**. As a best practice, you should not grant any perks to users until the entitlements are created.

#### Subscription Update

Sent when a [Subscription](/developers/resources/subscription) for a Premium App has been updated. Inner payload is a [Subscription](/developers/resources/subscription#subscription-object) object.

#### Subscription Delete

Sent when a [Subscription](/developers/resources/subscription) for a Premium App has been deleted. Inner payload is a [Subscription](/developers/resources/subscription#subscription-object) object.

### Polls

#### Message Poll Vote Add

Sent when a user votes on a poll. If the poll allows multiple selection, one event will be sent per answer.

<ManualAnchor id="message-poll-vote-add-message-poll-vote-add-fields" />

###### Message Poll Vote Add Fields

| Field       | Type      | Description       |
| ----------- | --------- | ----------------- |
| user\_id    | snowflake | ID of the user    |
| channel\_id | snowflake | ID of the channel |
| message\_id | snowflake | ID of the message |
| guild\_id?  | snowflake | ID of the guild   |
| answer\_id  | integer   | ID of the answer  |

#### Message Poll Vote Remove

Sent when a user removes their vote on a poll. If the poll allows for multiple selections, one event will be sent per answer.

<ManualAnchor id="message-poll-vote-remove-message-poll-vote-remove-fields" />

###### Message Poll Vote Remove Fields

| Field       | Type      | Description       |
| ----------- | --------- | ----------------- |
| user\_id    | snowflake | ID of the user    |
| channel\_id | snowflake | ID of the channel |
| message\_id | snowflake | ID of the message |
| guild\_id?  | snowflake | ID of the guild   |
| answer\_id  | integer   | ID of the answer  |

### Rate Limits

#### Rate Limited

Sent when an app encounters a gateway rate limit for an event, such as [Request Guild Members](/developers/events/gateway-events#request-guild-members).

<Info>
  See changelog for [Introducing Rate Limit When Requesting All Guild Members](/developers/change-log#introducing-rate-limit-when-requesting-all-guild-members) for more information and timeline on this new rate limit.
</Info>

###### Rate Limited Fields

| Field        | Type                                                                                                                      | Description                                                                                                              |
| ------------ | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| opcode       | integer                                                                                                                   | [Gateway opcode](/developers/topics/opcodes-and-status-codes#gateway-gateway-opcodes) of the event that was rate limited |
| retry\_after | float                                                                                                                     | The number of seconds to wait before submitting another request                                                          |
| meta         | [Rate Limit Metadata for Opcode](/developers/events/gateway-events#rate-limited-rate-limit-metadata-for-opcode-structure) | Metadata for the event that was rate limited                                                                             |

###### Rate Limit Metadata for Opcode Structure

| Opcode | Type                                                                                                                                          |
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| 8      | [Request Guild Member Rate Limit Metadata](/developers/events/gateway-events#rate-limited-request-guild-member-rate-limit-metadata-structure) |

###### Request Guild Member Rate Limit Metadata Structure

| Field     | Type      | Description                                                                                                 |
| --------- | --------- | ----------------------------------------------------------------------------------------------------------- |
| guild\_id | snowflake | ID of the guild to get members for                                                                          |
| nonce?    | string    | nonce to identify the [Guild Members Chunk](/developers/events/gateway-events#guild-members-chunk) response |
