Skip to main content
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. For more information about interacting with the Gateway, you can reference the Gateway documentation.
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.

Event Names

In practice, event names are UPPER-CASED with under_scores joining each word in the name. For instance, Channel Create would be CHANNEL_CREATE and 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.
FieldTypeDescription
opintegerGateway opcode, which indicates the payload type
d?mixed (any JSON value)Event data
s?integer *Sequence number of event used for resuming sessions and heartbeating
t?string *Event name
* s and t are null when op is not 0 (Gateway Dispatch opcode).
Example Gateway Event Payload
{
  "op": 0,
  "d": {},
  "s": 42,
  "t": "GATEWAY_EVENT_NAME"
}

Send Events

Send events are Gateway events encapsulated in an event payload, and are sent by an app to Discord through a Gateway connection.
Previously, Gateway send events were labeled as commands
NameDescription
IdentifyTriggers the initial handshake with the gateway
ResumeResumes a dropped gateway connection
HeartbeatMaintains an active gateway connection
Request Guild MembersRequests members for a guild
Request Soundboard SoundsRequests soundboard sounds in a set of guilds
Update Voice StateJoins, moves, or disconnects the app from a voice channel
Update PresenceUpdates an app’s presence

Identify

Used to trigger the initial handshake with the gateway. Details about identifying is in the Gateway documentation.
Identify Structure
FieldTypeDescriptionDefault
tokenstringAuthentication token-
propertiesobjectConnection properties-
compress?booleanWhether this connection supports compression of packetsfalse
large_threshold?integerValue between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list50
shard?array of two integers (shard_id, num_shards)Used for Guild Sharding-
presence?update presence objectPresence structure for initial presence information-
intentsintegerGateway Intents you wish to receive-
Identify Connection Properties
FieldTypeDescription
osstringYour operating system
browserstringYour library name
devicestringYour library name
These fields originally were prefixed(i.e: prefixed (i.e: `browser`) but this syntax is deprecated. While they currently still work, it is recommended to move to non-prefixed fields.
Example Identify
{
  "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
    },
    // This intent represents 1 << 0 for GUILDS, 1 << 1 for GUILD_MEMBERS, and 1 << 2 for GUILD_BANS
    // This connection will only receive the events defined in those three intents
    "intents": 7
  }
}

Resume

Used to replay missed events when a disconnected client resumes. Details about resuming are in the Gateway documentation.
Resume Structure
FieldTypeDescription
tokenstringSession token
session_idstringSession ID
seqintegerLast sequence number received
Example Resume
{
  "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 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.
Example Heartbeat
{
  "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, 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), 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 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
We are introducing a new rate limit to the Request Guild Members opcode. See Introducing Rate Limit When Requesting All Guild Members for more information and timeline on this new rate limit.
Request Guild Members Structure
FieldTypeDescriptionRequired
guild_idsnowflakeID of the guild to get members fortrue
query?stringstring that username starts with, or an empty string to return all membersone of query or user_ids
limitintegermaximum number of members to send matching the query; a limit of 0 can be used with an empty string query to return all memberstrue when specifying query
presences?booleanused to specify if we want the presences of the matched membersfalse
user_ids?snowflake or array of snowflakesused to specify which users you wish to fetchone of query or user_ids
nonce?stringnonce to identify the Guild Members Chunk responsefalse
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.
Example Request Guild Members
{
  "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 events for each guild in response.
Request Soundboard Sounds Structure
FieldTypeDescription
guild_idsarray of snowflakesIDs of the guilds to get soundboard sounds for
Example Request Soundboard Sounds
{
  "op": 31,
  "d": {
    "guild_ids": ["613425648685547541", "81384788765712384"]
  }
}

Update Voice State

Sent when a client wants to join, move, or disconnect from a voice channel.
Gateway Voice State Update Structure
FieldTypeDescription
guild_idsnowflakeID of the guild
channel_id?snowflakeID of the voice channel client wants to join (null if disconnecting)
self_mutebooleanWhether the client is muted
self_deafbooleanWhether the client deafened
Example Gateway Voice State Update
{
  "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.
Gateway Presence Update Structure
FieldTypeDescription
since?integerUnix time (in milliseconds) of when the client went idle, or null if the client is not idle
activitiesarray of activity objectsUser’s activities
statusstringUser’s new status
afkbooleanWhether or not the client is afk
Status Types
StatusDescription
onlineOnline
dndDo Not Disturb
idleAFK
invisibleInvisible and shown as offline
offlineOffline
Example Gateway Presence Update
{
  "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, 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.
NameDescription
HelloDefines the heartbeat interval
ReadyContains the initial state information
ResumedResponse to Resume
ReconnectServer is going away, client should reconnect to gateway and resume
Rate LimitedApplication was rate limited for a gateway opcode
Invalid SessionFailure response to Identify or Resume or invalid active session
Application Command Permissions UpdateApplication command permission was updated
Auto Moderation Rule CreateAuto Moderation rule was created
Auto Moderation Rule UpdateAuto Moderation rule was updated
Auto Moderation Rule DeleteAuto Moderation rule was deleted
Auto Moderation Action ExecutionAuto Moderation rule was triggered and an action was executed (e.g. a message was blocked)
Channel CreateNew guild channel created
Channel UpdateChannel was updated
Channel DeleteChannel was deleted
Channel Pins UpdateMessage was pinned or unpinned
Thread CreateThread created, also sent when being added to a private thread
Thread UpdateThread was updated
Thread DeleteThread was deleted
Thread List SyncSent when gaining access to a channel, contains all active threads in that channel
Thread Member UpdateThread member for the current user was updated
Thread Members UpdateSome user(s) were added to or removed from a thread
Entitlement CreateEntitlement was created
Entitlement UpdateEntitlement was updated or renewed
Entitlement DeleteEntitlement was deleted
Guild CreateLazy-load for unavailable guild, guild became available, or user joined a new guild
Guild UpdateGuild was updated
Guild DeleteGuild became unavailable, or user left/was removed from a guild
Guild Audit Log Entry CreateA guild audit log entry was created
Guild Ban AddUser was banned from a guild
Guild Ban RemoveUser was unbanned from a guild
Guild Emojis UpdateGuild emojis were updated
Guild Stickers UpdateGuild stickers were updated
Guild Integrations UpdateGuild integration was updated
Guild Member AddNew user joined a guild
Guild Member RemoveUser was removed from a guild
Guild Member UpdateGuild member was updated
Guild Members ChunkResponse to Request Guild Members
Guild Role CreateGuild role was created
Guild Role UpdateGuild role was updated
Guild Role DeleteGuild role was deleted
Guild Scheduled Event CreateGuild scheduled event was created
Guild Scheduled Event UpdateGuild scheduled event was updated
Guild Scheduled Event DeleteGuild scheduled event was deleted
Guild Scheduled Event User AddUser subscribed to a guild scheduled event
Guild Scheduled Event User RemoveUser unsubscribed from a guild scheduled event
Guild Soundboard Sound CreateGuild soundboard sound was created
Guild Soundboard Sound UpdateGuild soundboard sound was updated
Guild Soundboard Sound DeleteGuild soundboard sound was deleted
Guild Soundboard Sounds UpdateGuild soundboard sounds were updated
Soundboard SoundsResponse to Request Soundboard Sounds
Integration CreateGuild integration was created
Integration UpdateGuild integration was updated
Integration DeleteGuild integration was deleted
Interaction CreateUser used an interaction, such as an Application Command
Invite CreateInvite to a channel was created
Invite DeleteInvite to a channel was deleted
Message CreateMessage was created
Message UpdateMessage was edited
Message DeleteMessage was deleted
Message Delete BulkMultiple messages were deleted at once
Message Reaction AddUser reacted to a message
Message Reaction RemoveUser removed a reaction from a message
Message Reaction Remove AllAll reactions were explicitly removed from a message
Message Reaction Remove EmojiAll reactions for a given emoji were explicitly removed from a message
Presence UpdateUser was updated
Stage Instance CreateStage instance was created
Stage Instance UpdateStage instance was updated
Stage Instance DeleteStage instance was deleted or closed
Subscription CreatePremium App Subscription was created
Subscription UpdatePremium App Subscription was updated
Subscription DeletePremium App Subscription was deleted
Typing StartUser started typing in a channel
User UpdateProperties about the user changed
Voice Channel Effect SendSomeone sent an effect in a voice channel the current user is connected to
Voice State UpdateSomeone joined, left, or moved a voice channel
Voice Server UpdateGuild’s voice server was updated
Webhooks UpdateGuild channel webhook was created, update, or deleted
Message Poll Vote AddUser voted on a poll
Message Poll Vote RemoveUser removed a vote on a poll

Hello

Sent on connection to the websocket. Defines the heartbeat interval that an app should heartbeat to.
Hello Structure
FieldTypeDescription
heartbeat_intervalintegerInterval (in milliseconds) an app should heartbeat with
Example Hello
{
  "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 events.
Ready Event Fields
FieldTypeDescription
vintegerAPI version
useruser objectInformation about the user including email
guildsarray of Unavailable Guild objectsGuilds the user is in
session_idstringUsed for resuming connections
resume_gateway_urlstringGateway URL for resuming connections
shard?array of two integers (shard_id, num_shards)Shard information associated with this session, if sent when identifying
applicationpartial application objectContains id and flags

Resumed

The resumed event is dispatched when a client has sent a resume payload 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 event. A few seconds after the reconnect event is dispatched, the connection may be closed by the server.
Example Gateway Reconnect
{
  "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
  • the gateway could not resume a previous session after receiving an Opcode 6 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 and Resuming for more information.
Example Gateway Invalid Session
{
  "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 object.

Auto Moderation

All 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 object.

Auto Moderation Rule Update

Sent when a rule is updated. The inner payload is an auto moderation rule object.

Auto Moderation Rule Delete

Sent when a rule is deleted. The inner payload is an auto moderation rule object.

Auto Moderation Action Execution

Sent when a rule is triggered and an action is executed (e.g. when a message is blocked).
Auto Moderation Action Execution Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild in which action was executed
actionauto moderation action objectAction which was executed
rule_idsnowflakeID of the rule which action belongs to
rule_trigger_typetrigger_typeTrigger type of rule which was triggered
user_idsnowflakeID of the user which generated the content which triggered the rule
channel_id?snowflakeID of the channel in which user content was posted
message_id?snowflakeID of any user message which content belongs to *
alert_system_message_id?snowflakeID of any system auto moderation messages posted as a result of this action **
content ***stringUser-generated text content
matched_keyword?stringWord or phrase configured in the rule that triggered the rule
matched_content ***?stringSubstring in content that triggered the rule
* message_id will not exist if message was blocked by 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 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 object.

Channel Update

Sent when a channel is updated. The inner payload is a channel 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 events (or 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 object.

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 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 object.

Thread Update

Sent when a thread is updated. The inner payload is a channel 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 events.

Thread Delete

Sent when a thread relevant to the current user is deleted. The inner payload is a subset of the channel 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.
Thread List Sync Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
channel_ids?array of snowflakesParent 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.
threadsarray of channel objectsAll active threads in the given channels that the current user can access
membersarray of thread member objectsAll 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 object for the current user is updated. The inner payload is a thread member 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 for more details.
Thread Member Update Event Extra Fields
FieldTypeDescription
guild_idsnowflakeID 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, then this event will only be sent if the current user was added to or removed from the thread.
Thread Members Update Event Fields
FieldTypeDescription
idsnowflakeID of the thread
guild_idsnowflakeID of the guild
member_countintegerApproximate number of members in the thread, capped at 50
added_members?*array of thread member objectsUsers who were added to the thread
removed_member_ids?array of snowflakesID of the users who were removed from the thread
* In this gateway event, the thread member objects will also include the guild member and nullable 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.
Channel Pins Update Event Fields
FieldTypeDescription
guild_id?snowflakeID of the guild
channel_idsnowflakeID of the channel
last_pin_timestamp??ISO8601 timestampTime at which the most recent pinned message was pinned

Entitlements

Entitlement Create

Note: TheENTITLEMENT_CREATE event behavior changed on October 1, 2024. Please see the Change Log and Entitlement Migration Guide for more information on what changed.
Sent when an entitlement is created. The inner payload is an entitlement object.

Entitlement Update

Note: TheENTITLEMENT_UPDATE event behavior changed on October 1, 2024. Please see the Change Log and Entitlement Migration Guide for more information on what changed.
Sent when an entitlement is updated. The inner payload is an entitlement 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 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 event. Guilds that are unavailable due to an outage will send a Guild Delete event.
  2. When a Guild becomes available again to the client.
  3. When the current user joins a new Guild.
During an outage, the guild object in scenarios 1 and 3 may be marked as unavailable.
The inner payload can be:
  • An available Guild: a guild object with extra fields, as noted below.
  • An unavailable Guild: an unavailable guild object.
Guild Create Extra Fields
FieldTypeDescription
joined_atISO8601 timestampWhen this guild was joined at
largebooleantrue if this is considered a large guild
unavailable?booleantrue if this guild is unavailable due to an outage
member_countintegerTotal number of members in this guild
voice_statesarray of partial voice state objectsStates of members currently in voice channels; lacks the guild_id key
membersarray of guild member objectsUsers in the guild
channelsarray of channel objectsChannels in the guild
threadsarray of channel objectsAll active threads in the guild that current user has permission to view
presencesarray of partial presence update objectsPresences of the members in the guild, will only include non-offline members if the size is greater than large threshold
stage_instancesarray of stage instance objectsStage instances in the guild
guild_scheduled_eventsarray of guild scheduled event objectsScheduled events in the guild
soundboard_soundsarray of soundboard sound objectsSoundboard sounds in the guild
If your bot does not have the GUILD_PRESENCES Gateway Intent, 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.

Guild Update

Sent when a guild is updated. The inner payload is a guild 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 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 object with an extra guild_id key. This event is only sent to bots with the VIEW_AUDIT_LOG permission.
Guild Audit Log Entry Create Event Extra Fields
FieldTypeDescription
guild_idsnowflakeID of the guild

Guild Ban Add

Sent when a user is banned from a guild.
Guild Ban Add Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
usera user objectUser who was banned

Guild Ban Remove

Sent when a user is unbanned from a guild.
Guild Ban Remove Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
usera user objectUser who was unbanned

Guild Emojis Update

Sent when a guild’s emojis have been updated.
Guild Emojis Update Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
emojisarrayArray of emojis

Guild Stickers Update

Sent when a guild’s stickers have been updated.
Guild Stickers Update Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
stickersarrayArray of stickers

Guild Integrations Update

Sent when a guild integration is updated.
Guild Integrations Update Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild whose integrations were updated

Guild Member Add

If using Gateway Intents, the GUILD_MEMBERS intent will be required to receive this event.
Sent when a new user joins a guild. The inner payload is a guild member object with an extra guild_id key:
Guild Member Add Extra Fields
FieldTypeDescription
guild_idsnowflakeID of the guild

Guild Member Remove

If using Gateway Intents, the GUILD_MEMBERS intent will be required to receive this event.
Sent when a user is removed from a guild (leave/kick/ban).
Guild Member Remove Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
usera user objectUser who was removed

Guild Member Update

If using Gateway Intents, the GUILD_MEMBERS intent will be required to receive this event.
Sent when a guild member is updated. This will also fire when the user object of a guild member changes.
Guild Member Update Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
rolesarray of snowflakesUser role ids
usera user objectUser
nick??stringNickname of the user in the guild
avatar?stringMember’s guild avatar hash
banner?stringMember’s guild banner hash
joined_at?ISO8601 timestampWhen the user joined the guild
premium_since??ISO8601 timestampWhen the user starting boosting the guild
deaf?booleanWhether the user is deafened in voice channels
mute?booleanWhether the user is muted in voice channels
pending?booleanWhether the user has not yet passed the guild’s Membership Screening requirements
communication_disabled_until??ISO8601 timestampWhen the user’s timeout 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 dataData for the member’s guild avatar decoration

Guild Members Chunk

Sent in response to Guild Request Members. You can use the chunk_index and chunk_count to calculate how many chunks are left for your request.
Guild Members Chunk Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
membersarray of guild member objectsSet of guild members
chunk_indexintegerChunk index in the expected chunks for this response (0 <= chunk_index < chunk_count)
chunk_countintegerTotal number of expected chunks for this response
not_found?arrayWhen passing an invalid ID to REQUEST_GUILD_MEMBERS, it will be returned here
presences?array of presence objectsWhen passing true to REQUEST_GUILD_MEMBERS, presences of the returned members will be here
nonce?stringNonce used in the Guild Members Request

Guild Role Create

Sent when a guild role is created.
Guild Role Create Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
rolea role objectRole that was created

Guild Role Update

Sent when a guild role is updated.
Guild Role Update Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
rolea role objectRole that was updated

Guild Role Delete

Sent when a guild role is deleted.
Guild Role Delete Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
role_idsnowflakeID of the role

Guild Scheduled Event Create

Sent when a guild scheduled event is created. The inner payload is a guild scheduled event object.

Guild Scheduled Event Update

Sent when a guild scheduled event is updated. The inner payload is a guild scheduled event object.

Guild Scheduled Event Delete

Sent when a guild scheduled event is deleted. The inner payload is a guild scheduled event object.

Guild Scheduled Event User Add

Sent when a user has subscribed to a guild scheduled event.
Guild Scheduled Event User Add Event Fields
FieldTypeDescription
guild_scheduled_event_idsnowflakeID of the guild scheduled event
user_idsnowflakeID of the user
guild_idsnowflakeID of the guild

Guild Scheduled Event User Remove

Sent when a user has unsubscribed from a guild scheduled event.
Guild Scheduled Event User Remove Event Fields
FieldTypeDescription
guild_scheduled_event_idsnowflakeID of the guild scheduled event
user_idsnowflakeID of the user
guild_idsnowflakeID of the guild

Guild Soundboard Sound Create

Sent when a guild soundboard sound is created. The inner payload is a soundboard sound object.

Guild Soundboard Sound Update

Sent when a guild soundboard sound is updated. The inner payload is a soundboard sound object.

Guild Soundboard Sound Delete

Sent when a guild soundboard sound is deleted.
Guild Soundboard Sound Delete Event Fields
FieldTypeDescription
sound_idsnowflakeID of the sound that was deleted
guild_idsnowflakeID of the guild the sound was in

Guild Soundboard Sounds Update

Sent when multiple guild soundboard sounds are updated.
Guild Soundboard Sounds Update Event Fields
FieldTypeDescription
soundboard_soundsarray of soundboard sound objectsThe guild’s soundboard sounds
guild_idsnowflakeID of the guild

Soundboard Sounds

Includes a guild’s list of soundboard sounds. Sent in response to Request Soundboard Sounds.
Soundboard Sounds Event Fields
FieldTypeDescription
soundboard_soundsarray of soundboard sound objectsThe guild’s soundboard sounds
guild_idsnowflakeID of the guild

Integrations

Integration Create

Sent when an integration is created. The inner payload is an integration object with user omitted and an additional guild_id key:
Integration Create Event Additional Fields
FieldTypeDescription
guild_idsnowflakeID of the guild

Integration Update

Sent when an integration is updated. The inner payload is an integration object with user omitted and an additional guild_id key:
Integration Update Event Additional Fields
FieldTypeDescription
guild_idsnowflakeID of the guild

Integration Delete

Sent when an integration is deleted.
Integration Delete Event Fields
FieldTypeDescription
idsnowflakeIntegration ID
guild_idsnowflakeID of the guild
application_id?snowflakeID of the bot/OAuth2 application for this discord integration

Invites

All 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.
Invite Create Event Fields
FieldTypeDescription
channel_idsnowflakeChannel the invite is for
codestringUnique invite code
created_atISO8601 timestampTime at which the invite was created
guild_id?snowflakeGuild of the invite
inviter?user objectUser that created the invite
max_ageintegerHow long the invite is valid for (in seconds)
max_usesintegerMaximum number of times the invite can be used
target_type?integerType of target for this voice channel invite
target_user?user objectUser whose stream to display for this voice channel stream invite
target_application?partial application objectEmbedded application to open for this voice channel embedded application invite
temporarybooleanWhether or not the invite is temporary (invited users will be kicked on disconnect unless they’re assigned a role)
usesintegerHow many times the invite has been used (always will be 0)
expires_at?ISO8601 timestampthe expiration date of this invite

Invite Delete

Sent when an invite is deleted.
Invite Delete Event Fields
FieldTypeDescription
channel_idsnowflakeChannel of the invite
guild_id?snowflakeGuild of the invite
codestringUnique invite code

Messages

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, and the message object won’t include guild_id or member.

Message Create

Sent when a message is created. The inner payload is a message object with the following extra fields:
Message Create Extra Fields
FieldTypeDescription
guild_id?snowflakeID of the guild the message was sent in - unless it is an ephemeral message
member?partial guild member objectMember properties for this message’s author. Missing for ephemeral messages and messages from webhooks
mentionsarray of user objects, with an additional partial member fieldUsers specifically mentioned in the message

Message Update

Sent when a message is updated. The inner payload is a message object with the same extra fields as MESSAGE_CREATE.
The value for tts will always be false in message updates.

Message Delete

Sent when a message is deleted.
Message Delete Event Fields
FieldTypeDescription
idsnowflakeID of the message
channel_idsnowflakeID of the channel
guild_id?snowflakeID of the guild

Message Delete Bulk

Sent when multiple messages are deleted at once.
Message Delete Bulk Event Fields
FieldTypeDescription
idsarray of snowflakesIDs of the messages
channel_idsnowflakeID of the channel
guild_id?snowflakeID of the guild

Message Reaction Add

Sent when a user adds a reaction to a message.
Message Reaction Add Event Fields
FieldTypeDescription
user_idsnowflakeID of the user
channel_idsnowflakeID of the channel
message_idsnowflakeID of the message
guild_id?snowflakeID of the guild
member?member objectMember who reacted if this happened in a guild
emojia partial emoji objectEmoji used to react - example
message_author_id?snowflakeID of the user who authored the message which was reacted to
burstbooleantrue if this is a super-reaction
burst_colors?array of stringsColors used for super-reaction animation in “#rrggbb” format
typeintegerThe type of reaction

Message Reaction Remove

Sent when a user removes a reaction from a message.
Message Reaction Remove Event Fields
FieldTypeDescription
user_idsnowflakeID of the user
channel_idsnowflakeID of the channel
message_idsnowflakeID of the message
guild_id?snowflakeID of the guild
emojia partial emoji objectEmoji used to react - example
burstbooleantrue if this was a super-reaction
typeintegerThe type of reaction

Message Reaction Remove All

Sent when a user explicitly removes all reactions from a message.
Message Reaction Remove All Event Fields
FieldTypeDescription
channel_idsnowflakeID of the channel
message_idsnowflakeID of the message
guild_id?snowflakeID of the guild

Message Reaction Remove Emoji

Sent when a bot removes all instances of a given emoji from the reactions of a message.
Message Reaction Remove Emoji Event Fields
FieldTypeDescription
channel_idsnowflakeID of the channel
guild_id?snowflakeID of the guild
message_idsnowflakeID of the message
emojipartial emoji objectEmoji that was removed

Presence

Presence Update

If you are using Gateway Intents, you must specify the GUILD_PRESENCES intent in order to receive Presence Update events
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.
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.
Presence Update Event Fields
FieldTypeDescription
useruser objectUser whose presence is being updated
guild_idsnowflakeID of the guild
statusstringEither “idle”, “dnd”, “online”, or “offline”
activitiesarray of activity objectsUser’s current activities
client_statusclient_status objectUser’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.
FieldTypeDescription
desktop?stringUser’s status set for an active desktop (Windows, Linux, Mac) application session
mobile?stringUser’s status set for an active mobile (iOS, Android) application session
web?stringUser’s status set for an active web (browser, bot user) application session

Activity Object

Activity Structure
FieldTypeDescription
namestringActivity’s name
typeintegerActivity type
url??stringStream URL, is validated when type is 1
created_atintegerUnix timestamp (in milliseconds) of when the activity was added to the user’s session
timestamps?timestamps objectUnix timestamps for start and/or end of the game
application_id?snowflakeApplication ID for the game
status_display_type??integerStatus display type; controls which field is displayed in the user’s status text in the member list
details??stringWhat the player is currently doing
details_url??stringURL that is linked when clicking on the details text
state??stringUser’s current party status, or text used for a custom status
state_url??stringURL that is linked when clicking on the state text
emoji??emoji objectEmoji used for a custom status
party?party objectInformation for the current party of the player
assets?assets objectImages for the presence and their hover texts
secrets?secrets objectSecrets for Rich Presence joining and spectating
instance?booleanWhether or not the activity is an instanced game session
flags?integerActivity flags ORd together, describes what the payload includes
buttons?array of buttonsCustom buttons shown in the Rich Presence (max 2)
Bot users are only able to set name, state, type, and url.
Activity Types
IDNameFormatExample
0PlayingPlaying {name}”Playing Rocket League”
1StreamingStreaming {details}”Streaming Rocket League”
2ListeningListening to {name}”Listening to Spotify”
3WatchingWatching {name}”Watching YouTube Together”
4Custom{emoji} {state}”:smiley: I am cool”
5CompetingCompeting in {name}”Competing in Arena World Champions”
The streaming type currently only supports Twitch and YouTube. Only https://twitch.tv/ and https://youtube.com/ urls will work.
Status Display Types
IDNameExample
0Name”Listening to Spotify”
1State”Listening to Rick Astley”
2Details”Listening to Never Gonna Give You Up”
This applies to all activity types. “Listening” was used to serve as a consistent example of what the different fields might be used for.
Activity Timestamps
FieldTypeDescription
start?integerUnix time (in milliseconds) of when the activity started
end?integerUnix time (in milliseconds) of when the activity ends
For Listening and Watching activities, you can include both start and end timestamps to display a time bar.
Activity Emoji
FieldTypeDescription
namestringName of the emoji
id?snowflakeID of the emoji
animated?booleanWhether the emoji is animated
Activity Party
FieldTypeDescription
id?stringID of the party
size?array of two integers (current_size, max_size)Used to show the party’s current and maximum size
Activity Assets
FieldTypeDescription
large_image?stringSee Activity Asset Image
large_text?stringText displayed when hovering over the large image of the activity
large_url?stringURL that is opened when clicking on the large image
small_image?stringSee Activity Asset Image
small_text?stringText displayed when hovering over the small image of the activity
small_url?stringURL that is opened when clicking on the small 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.
TypeFormatImage URL
Application Asset{application_asset_id}See Application Asset Image Formatting
Media Proxy Imagemp:{image_id}https://media.discordapp.net/{image_id}
Activity Secrets
FieldTypeDescription
join?stringSecret for joining a party
spectate?stringSecret for spectating a game
match?stringSecret for a specific instanced match
Activity Flags
NameValue
INSTANCE1 << 0
JOIN1 << 1
SPECTATE1 << 2
JOIN_REQUEST1 << 3
SYNC1 << 4
PLAY1 << 5
PARTY_PRIVACY_FRIENDS1 << 6
PARTY_PRIVACY_VOICE_CHANNEL1 << 7
EMBEDDED1 << 8
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:
FieldTypeDescription
labelstringText shown on the button (1-32 characters)
urlstringURL opened when clicking the button (1-512 characters)
Example Activity
{
  "details": "24H RL Stream for Charity",
  "state": "Rocket League",
  "name": "Twitch",
  "type": 1,
  "url": "https://www.twitch.tv/discord"
}
Example Activity with Rich Presence
{
  "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"
  }
}
Clients may only update their game status 5 times per 20 seconds.

Typing Start

Sent when a user starts typing in a channel.
Typing Start Event Fields
FieldTypeDescription
channel_idsnowflakeID of the channel
guild_id?snowflakeID of the guild
user_idsnowflakeID of the user
timestampintegerUnix time (in seconds) of when the user started typing
member?member objectMember 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 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.
Voice Channel Effect Send Event Fields
FieldTypeDescription
channel_idsnowflakeID of the channel the effect was sent in
guild_idsnowflakeID of the guild the effect was sent in
user_idsnowflakeID of the user who sent the effect
emoji??emoji objectThe emoji sent, for emoji reaction and soundboard effects
animation_type??integerThe type of emoji animation, for emoji reaction and soundboard effects
animation_id?integerThe ID of the emoji animation, for emoji reaction and soundboard effects
sound_id?snowflake or integerThe ID of the soundboard sound, for soundboard effects
sound_volume?doubleThe volume of the soundboard sound, from 0 to 1, for soundboard effects
Animation Types
TypeValueDescription
PREMIUM0A fun animation, sent by a Nitro subscriber
BASIC1The standard animation

Voice State Update

Sent when someone joins/leaves/moves voice channels. Inner payload is a voice state 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.
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.
Voice Server Update Event Fields
FieldTypeDescription
tokenstringVoice connection token
guild_idsnowflakeGuild this voice server update is for
endpoint?stringVoice server host
Example Voice Server Update Payload
{
  "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.
Webhooks Update Event Fields
FieldTypeDescription
guild_idsnowflakeID of the guild
channel_idsnowflakeID of the channel

Interactions

Interaction Create

Sent when a user uses an Application Command or Message Component. Inner payload is an Interaction.

Stage Instances

Stage Instance Create

Sent when a Stage instance is created (i.e. the Stage is now “live”). Inner payload is a Stage instance

Stage Instance Update

Sent when a Stage instance has been updated. Inner payload is a Stage instance

Stage Instance Delete

Sent when a Stage instance has been deleted (i.e. the Stage has been closed). Inner payload is a Stage instance

Subscriptions

Subscription Create

Subscription status should not be used to grant perks. Use entitlements as an indication of whether a user should have access to a specific SKU. See our guide on Implementing App Subscriptions for more information.
Sent when a Subscription for a Premium App is created. Inner payload is a Subscription. 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 for a Premium App has been updated. Inner payload is a Subscription object.

Subscription Delete

Sent when a Subscription for a Premium App has been deleted. Inner payload is a Subscription 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.
Message Poll Vote Add Fields
FieldTypeDescription
user_idsnowflakeID of the user
channel_idsnowflakeID of the channel
message_idsnowflakeID of the message
guild_id?snowflakeID of the guild
answer_idintegerID 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.
Message Poll Vote Remove Fields
FieldTypeDescription
user_idsnowflakeID of the user
channel_idsnowflakeID of the channel
message_idsnowflakeID of the message
guild_id?snowflakeID of the guild
answer_idintegerID of the answer

Rate Limits

Rate Limited

Sent when an app encounters a gateway rate limit for an event, such as Request Guild Members.
See changelog for Introducing Rate Limit When Requesting All Guild Members for more information and timeline on this new rate limit.
Rate Limited Fields
FieldTypeDescription
opcodeintegerGateway opcode of the event that was rate limited
retry_afterfloatThe number of seconds to wait before submitting another request
metaRate Limit Metadata for OpcodeMetadata for the event that was rate limited
Rate Limit Metadata for Opcode Structure
Request Guild Member Rate Limit Metadata Structure
FieldTypeDescription
guild_idsnowflakeID of the guild to get members for
nonce?stringnonce to identify the Guild Members Chunk response