Skip to content
Fluxer API

Gateway events

A Dispatch tells a Gateway session that something changed or answers one of its commands. It has opcode 0, an event name in t and the payload in d.

FieldTypeDescription
opintegerValue 0
tstringUppercase event name
sintegerNon-negative session sequence
danyPayload defined for the event in t
{
"op": 0,
"t": "MESSAGE_CREATE",
"s": 17,
"d": { }
}

Ready has sequence 1 and each live Dispatch after it adds one. Replayed Dispatches keep their original sequence and can have gaps. The sequence counts Dispatches for one session and says nothing about order across shards or HTTP requests.

Event filtering decides which sessions receive each Dispatch. A user session without the CHANNEL_THREADS flag also gets reduced payloads and no thread events.

Most guild events have a guild_id. Guild Create, Guild Sync and Guild Delete use id, and Guild Counts Update and Channel Member Counts Update put guild_id on each entry.

The session that made a change receives the Dispatch like any other session. The one exception is a guild-channel reaction, where the request's session_id excludes that session from Message Reaction Add and Message Reaction Remove.

Resume replays every Dispatch except Ready and the Guild Create and Guild Delete burst a bot gets after Ready. These events are live only and are never replayed.

Limits and rate limits explains when an oversized Dispatch is not kept.

EventDescription
ReadyThe initial session state after a successful Identify
ResumedReplay after a Resume is finished
Sessions ReplaceThe account's live sessions changed
Auth Session ChangeA password change replaced the authentication session
Rate LimitedA bot asked for a full member list too often
User UpdateThe current user's account record changes
User Settings UpdateThe current user's account-wide settings change
User Guild Settings UpdateOne guild notification record changes
User Note UpdateThe current user writes or clears a private note
User Pinned DMs UpdateThe current user's pinned private channel set is replaced
User Connections UpdateThe current user's external connection set is replaced
WebAuthn Credentials UpdateThe current user's WebAuthn credential set is replaced
Relationship AddThe current user gains a relationship
Relationship UpdateOne of the current user's relationships changes
Relationship RemoveThe current user loses a relationship
Saved Message CreateThe current user saves a message
Saved Message DeleteThe current user unsaves a message
Recent Mention DeleteThe current user removes a recent mention
Favorite Meme CreateThe current user saves a meme
Favorite Meme UpdateOne of the current user's memes changes
Favorite Meme DeleteThe current user deletes a meme
Guild CreateA guild becomes available to the session
Guild SyncA subscribed session receives the guild's full current state again
Guild UpdateA guild's configuration changes
Guild DeleteA guild leaves the session's visibility or becomes unavailable
Guild Role CreateA role is created in a guild
Guild Role UpdateOne role changed
Guild Role Update BulkSeveral roles changed at once
Guild Role DeleteA role is deleted from a guild
Guild Emojis UpdateA guild's emojis change
Guild Stickers UpdateA guild's stickers change
Channel CreateA channel becomes visible to the session
Channel UpdateA visible channel changes
Channel Update BulkOne operation changes several channels together
Channel DeleteA channel leaves the session's visibility
Channel Recipient AddA user joins a group direct message the session belongs to
Channel Recipient RemoveA user leaves a group direct message the session belongs to
Webhooks UpdateThe webhook set of a viewable guild channel changes
Invite CreateAn invite is created
Invite DeleteAn invite is deleted
Thread CreateA thread is created or the session joins one
Thread UpdateA visible thread changes
Thread DeleteA thread is deleted
Thread List SyncThe session's active thread set is replaced
Thread Member UpdateThe session's own thread membership changes
Thread Members UpdateUsers join or leave a thread
Thread Member List UpdateA subscribed thread member list changed
Forum UnreadsUnread counts for forum posts are returned
Guild Member AddA user becomes a member of a connected guild
Guild Member UpdateA member's guild state or public user representation changes
Guild Member RemoveA user stops being a member of a connected guild
Guild Members ChunkThe answer to Request Guild Members
Guild Member List UpdateA subscribed member list changed
Guild Audit Log Entry CreateAn audit log entry is written in a guild
Guild Ban AddA guild ban is created
Guild Ban RemoveA guild ban is removed
Presence UpdateOne visible presence changes
Presence Update BulkOnline presences of a guild that was unavailable
Passive UpdatesChannel last_message_id values or voice states changed for one passive session
Message CreateA visible message is created
Message UpdateA message changed
Message DeleteOne visible message is deleted
Message Delete BulkSeveral messages in one channel are deleted together
Message ACKThe current user's read state advances for a channel
Message Reaction AddA user adds a reaction to a message
Message Reaction Add ManySeveral reactions grouped into one event
Message Reaction RemoveOne user's reaction is removed from a message
Message Reaction Remove AllEvery reaction is removed from a message at once
Message Reaction Remove EmojiEvery reaction using one emoji is removed from a message
Typing StartA visible user begins typing in a channel
Channel Pins UpdateA channel's most recent pin time changes
Channel Pins ACKThe current user acknowledges a channel's pins
Voice State UpdateA guild or call participant's voice state changes
Voice Server UpdateThe session receives or replaces its own voice grant
Voice SignalA signaling message from another peer-to-peer connection
Entrance Sound PlayA participant's entrance sound plays in a voice channel
Call CreateA private channel call begins or becomes visible
Call UpdateThe ringing set, participant roster, or region of a call changes
Call DeleteA call ends or becomes unavailable
Guild Counts UpdateMember and online counts are returned for connected guilds
Channel Member Counts UpdatePer-channel member and online counts are returned for one guild

The session's initial state, sent once after a successful Identify.

FieldTypeDescription
session_idstringIdentifier for Resume
versionintegerGateway API version the connection negotiated, always 1
useruser objectThe authenticated account in its private representation
guilds1array[guild ready object]The session's guilds
private_channelsarray[channel object]Direct message and group direct message channels
relationships2array[relationship object]The account's relationships
presences3array[presence object]Visible presences at connection time
users2array[partial user object]Users referenced by the payload
sessionsarray[session presence object]Every live session of the account, after a combined all entry
read_statesarray[read state object]Per-channel read state
user_settings?user settings objectAccount-wide settings
user_guild_settingsarray[user guild settings object]Per-guild notification settings
notesmap[snowflake, string]Private notes keyed by user ID
pinned_dmsarray[snowflake]Pinned private channel IDs
favorite_memesarray[meme object]Saved memes
webauthn_credentialsarray[WebAuthn credential object]Registered WebAuthn credentials
rtc_regionsarray[RTC region object]Voice regions, nearest first
country_codestringCountry of the connecting address, US when unknown
latitude?stringLatitude of the connecting address as a decimal string
longitude?stringLongitude of the connecting address as a decimal string
auth_session_id_hash?stringBase64url hash identifying the authentication session
shard?array[integer]The accepted [shard_id, shard_count] pair, when Identify sent one
_timings?objectHTTP-side timing breakdown, only for a staff account
_timings_gw?objectGateway-side timing breakdown, only for a staff account

1 On a bot session every entry is {"id": "...", "unavailable": true}, and a Guild Create or Guild Delete for each one follows Ready

2 Relationships in Ready have no user, and each guild member's user has only id. The full accounts are in users. A bot gets an empty users, its Guild Create burst after Ready has members with the same {"id": "..."} user, and it fetches the accounts with Request Guild Members. A later Guild Create and every Guild Sync have full members.

3 Always empty for a bot session

Shortly after Ready, the session gets a Call Create for each private channel with an active call.

The guild state in Ready, Guild Create and Guild Sync.

FieldTypeDescription
idsnowflakeGuild ID
propertiesguild objectGuild record without its roles, channels, emojis, stickers or members
rolesarray[guild role object]Every role in the guild
channelsarray[channel object]Channels the session can view
emojisarray[guild emoji object]Every emoji in the guild
stickersarray[guild sticker object]Every sticker in the guild
members1array[guild member object]The members the session needs immediately
member_countintegerTotal member count
online_countintegerMembers with a live session and a status other than offline or invisible
presences2array[presence object]Always an empty array
voice_statesarray[voice state object]Voice states in channels the session can view
joined_at?ISO8601 timestampWhen the account joined the guild, null when it is not a member
unavailable?booleanWhether the guild is unavailable
visiting?booleanWhether the account is visiting the guild without being a member
unavailable_hidden?booleanWhether an unavailable guild is hidden from the client
threads?3array[thread object]Active threads, as Guild threads describes

1 Only the session's own member and the members in voice_states. Use Request Guild Members or a member list from Lazy Request for the rest

2 Presences arrive as Presence Update and Presence Update Bulk

3 Only for a session with thread access

An unavailable guild has only id, unavailable: true and, when hidden, unavailable_hidden: true.

FieldTypeDescription
session_idstringSession identifier, or all for the combined entry
statusstringonline, idle, dnd, invisible or offline
afkbooleanWhether the session is away
mobilebooleanWhether the session is mobile

The first entry is always all, with the account's combined status.

FieldTypeDescription
idstringCredential ID
namestringCredential name
created_atISO8601 timestampWhen the credential was registered
last_used_at?ISO8601 timestampWhen the credential was last used
rp_idstringThe domain the passkey was created for, as in the WebAuthn credential object
FieldTypeDescription
idstringRegion ID
namestringHuman-readable region name
emojistringRegion emoji

The first entry is always automatic, which lets Fluxer pick the region. The rest are sorted by distance from the latitude and longitude in the Identify properties, or by ID when those are missing.

Sent after a successful Resume has replayed the missed Dispatches. Its s is the current sequence and the next live Dispatch adds one.

FieldTypeDescription
_timings_gw?objectGateway-side timing breakdown, only for a staff account

The account's live sessions changed. The payload is an array of every session presence object, and it replaces the sessions list from Ready.

A password change replaced the account's authentication session.

FieldTypeDescription
old_auth_session_id_hashstringBase64url hash of the replaced authentication session
new_auth_session_id_hashstringBase64url hash of the new authentication session

Fluxer closes the Gateway sessions of the old authentication session before it sends this event, and they never receive it.

A bot sent Request Guild Members for the full member list of a guild more than once in 30 seconds. Only the requesting session receives it.

FieldTypeDescription
opcodeintegerThe refused opcode, always 8
retry_afternumberSeconds until you can retry
metaobjectguild_id, plus nonce when the request had one

The current user's account changed. The payload is the user object in its private representation.

The current user's settings changed. The payload is the user settings object.

The notification settings for one guild changed. The payload is that guild's user guild settings object.

The current user wrote or cleared a private note.

FieldTypeDescription
idsnowflakeUser the note is about
notestringNote text, empty when cleared

The pinned private channels changed. The payload is an array of every pinned channel ID in order, and it replaces pinned_dms from Ready.

The current user's external connections changed.

FieldTypeDescription
connectionsarray[connection object]Every connection on the account

The current user's passkeys changed. The payload is an array of every WebAuthn credential object, and it replaces webauthn_credentials from Ready.

The current user has a new relationship.

FieldTypeDescription
idsnowflakeThe other user's ID
typeintegerRelationship type
userpartial user objectThe other user
since?ISO8601 timestampWhen the relationship was created
nickname?stringPrivate nickname for the other user
share_voice_activitybooleanWhether the current user shares voice activity with this friend
friend_shares_voice_activity1booleanWhether the other user shares voice activity with the current user

1 Only accurate in a Relationship Update sent by Modify voice activity sharing. List relationships always has the real value.

A relationship changed. The payload has the same fields as Relationship Add.

A relationship ended.

FieldTypeDescription
idsnowflakeThe other user's ID

The current user saved a message. The payload is the message object.

The current user unsaved a message.

FieldTypeDescription
message_idsnowflakeThe message that is no longer saved

The current user removed a message from their recent mentions.

FieldTypeDescription
message_idsnowflakeThe message removed from recent mentions

The current user saved a meme. The payload is the meme object.

One of the current user's memes changed. The payload is the meme object.

The current user deleted a meme.

FieldTypeDescription
meme_idsnowflakeThe deleted meme

A guild became available to the session, for example after joining it or when an unavailable guild recovers. The payload is a guild ready object.

Replace your stored roles, channels, emojis, stickers, voice_states and threads for the guild with the new arrays. members is partial, and you add or update those members and keep the others.

A later Guild Create without visiting means the account joined.

The guild's full state again, sent after a Lazy Request asks for a sync or switches the guild between active and passive. The payload is a guild ready object, handled like Guild Create.

A guild's settings changed. The payload is the guild object with guild_id added. An unavailable guild sends no other event.

The session lost a guild, or the guild became unavailable.

FieldTypeDescription
idsnowflakeGuild ID
guild_id?1snowflakeRepeats id
unavailable?booleanTrue when the guild is temporarily unavailable
unavailable_hidden?booleanTrue when an unavailable guild is hidden from the client

1 Only when the guild itself was deleted

Without unavailable, delete everything you store for the guild. With unavailable: true, keep it as unavailable until a Guild Create arrives.

A role was created.

FieldTypeDescription
guild_idsnowflakeGuild the role belongs to
roleguild role objectThe created role

One role changed.

FieldTypeDescription
guild_idsnowflakeGuild the role belongs to
roleguild role objectThe updated role

Several roles changed at once, usually in a reorder.

FieldTypeDescription
guild_idsnowflakeGuild the roles belong to
rolesarray[guild role object]Every changed role

A role was deleted.

FieldTypeDescription
guild_idsnowflakeGuild the role belonged to
role_idsnowflakeThe deleted role

A guild's emojis changed. Replace your stored emojis with the array.

FieldTypeDescription
guild_idsnowflakeGuild the emojis belong to
emojisarray[guild emoji object]Every emoji in the guild

A guild's stickers changed. Replace your stored stickers with the array.

FieldTypeDescription
guild_idsnowflakeGuild the stickers belong to
stickersarray[guild sticker object]Every sticker in the guild

A channel was created or the session can see it for the first time. The payload is the channel object.

A visible channel changed. The payload is the channel object.

Several channels changed at once, usually in a reorder. Each session gets only the channels it can view.

FieldTypeDescription
guild_idsnowflakeGuild the channels belong to
channelsarray[channel object]Every changed channel

A channel was deleted or the session can no longer see it. The payload is the channel object as it was before. Remove every thread whose parent_id is the channel yourself, because Fluxer sends no Thread Delete for them.

A user joined a group direct message the session is in.

FieldTypeDescription
channel_idsnowflakeGroup direct message channel
userpartial user objectThe user that joined

A user left a group direct message the session is in.

FieldTypeDescription
channel_idsnowflakeGroup direct message channel
userpartial user objectThe user that left

A guild channel's webhooks changed, including when a channel follow starts or ends. The event has no webhook data. Fetch the list with List channel webhooks.

FieldTypeDescription
guild_idsnowflakeGuild the channel belongs to
channel_idsnowflakeChannel whose webhooks changed

An invite was created. The payload is the invite object with its invite metadata. A guild invite goes to sessions with MANAGE_CHANNELS on its channel, and a group direct message invite goes to every recipient.

An invite was deleted. It goes to the same sessions as Invite Create.

FieldTypeDescription
codestringThe deleted invite code
channel_id?snowflakeChannel the invite pointed at
guild_id?snowflakeGuild the invite belonged to, absent for a group direct message invite

A user joined a guild. The payload is the guild member object with guild_id added.

A member or their public profile changed. The payload is the guild member object with guild_id added.

A user is no longer a member of a guild. Fluxer also sends a Thread Members Update for each thread they were in.

FieldTypeDescription
guild_idsnowflakeGuild the user left
userobjectThe user, with id only

The answer to Request Guild Members. A request that matches nobody still gets one chunk with an empty members.

FieldTypeDescription
guild_idsnowflakeGuild the members belong to
membersarray[guild member object]Up to 1,000 members
chunk_indexintegerZero-based index of this chunk
chunk_countintegerTotal chunks in this response
presences?array[presence object]Visible presences, when the request set presences
nonce?stringThe request's nonce, when it asked for one guild

A member list the session subscribed to with Lazy Request changed, and the event resends the subscribed ranges.

FieldTypeDescription
guild_idsnowflakeGuild the list belongs to
idstringList identifier, which is the channel ID
channel_id?snowflakeChannel the list is scoped to
member_countintegerTotal members in the list
online_countintegerOnline members in the list
groupsarray[member list group object]Group headers in list order
opsarray[member list operation object]Operations to apply
FieldTypeDescription
idstringA hoisted role ID, online or offline
countintegerMembers in the group

Hoisted roles come first, then online, then offline. Empty groups are left out, and so is the offline group and its members when it has more than 1,000 members.

FieldTypeDescription
opstringOperation kind, always SYNC
rangearray[integer]Inclusive [start, end] range this operation replaces
itemsarray[member list item object]Replacement items for the range

Each item has exactly one of these fields.

FieldTypeDescription
group?member list group objectA group header in one list position
member?1guild member objectA member of the list

1 With a presence field, which is {"status": "offline", "mobile": false, "afk": false} when the member is not visibly online

An audit log entry was written. Every session with VIEW_AUDIT_LOG gets it. The payload is the audit log entry with guild_id added and any ip entry left out of changes. Treat a missing options or changes as empty.

A user was banned.

FieldTypeDescription
guild_idsnowflakeGuild the ban was created in
userobjectThe banned user, with id only

A ban was removed.

FieldTypeDescription
guild_idsnowflakeGuild the ban was removed from
userobjectThe unbanned user, with id only

A visible presence changed. The payload is a presence object. You get presences for friends, group direct message recipients and the guild members you name in a Lazy Request, as Presence subscriptions describes.

FieldTypeDescription
userpartial user objectThe user the presence belongs to
statusstringonline, idle, dnd or offline
mobilebooleanWhether the user's active status comes from a mobile session
afkbooleanWhether every one of the user's sessions is away, always false when mobile is true
custom_status?custom status objectThe user's custom status, null when offline
guild_id?snowflakeGuild the presence came through

status is the first of dnd, online and idle that any live session has. An invisible user, or one with no live session, shows as offline. A session that loses its connection stops counting after 5 seconds.

FieldTypeDescription
text?stringCustom status text
expires_at?ISO8601 timestampWhen the custom status expires
emoji_id?snowflakeCustom emoji ID
emoji_name?stringUnicode emoji, or the custom emoji's name
emoji_animatedbooleanWhether the custom emoji is animated

The online presences of a guild that was unavailable, sent right after the Guild Create that restores it.

FieldTypeDescription
guild_idsnowflakeGuild the presences belong to
presencesarray[presence object]Up to 500 presences, split across several events when there are more

Fluxer sends this every 30 seconds, when something changed, for a guild with more than 250 members where the session is passive.

FieldTypeDescription
guild_idsnowflakeGuild the update is about
channelsmap[snowflake, snowflake]New last_message_id for each changed channel the session can view
voice_states?array[voice state object]Changed voice states, with a null channel_id for someone who left

A message was created. The payload is the message object with these fields added.

FieldTypeDescription
channel_typeintegerChannel type of the message's channel
nicks?map[snowflake, string]Group direct message nicknames, when the group has any
mention_here?booleantrue when the message has a here mention
guild_id?snowflakeGuild the channel belongs to
member?guild member objectThe author's member object without user, in a guild channel

A published message also arrives as Message Create in each following channel, with the IS_CROSSPOST flag.

A message changed. The payload is the full message object and, in a guild channel, guild_id and member as in Message Create. Sessions need READ_MESSAGE_HISTORY unless the message is newer than the guild's message history cutoff.

A message was deleted.

FieldTypeDescription
idsnowflakeThe deleted message
channel_idsnowflakeChannel the message was in
content?1?stringThe message's content before it was deleted
author_id?1snowflakeAccount that wrote the message
guild_id?snowflakeGuild the channel belongs to
member?guild member objectThe author's member object without user, when the author is still a member

1 Absent when an instance admin or Fluxer itself deleted the message

Several messages in one channel were deleted at once.

FieldTypeDescription
idsarray[snowflake]The deleted messages
channel_idsnowflakeChannel the messages were in
guild_id?snowflakeGuild the channel belongs to

The current user's read state moved forward in a channel, usually from another of their sessions.

FieldTypeDescription
channel_idsnowflakeChannel whose read state moved
message_idsnowflakeMessage the read state now points at
mention_countintegerRemaining mention count for the channel
manual?booleanWhether the user marked it read by hand
version?stringRead state version as a decimal string
flags?integerRead state flags, for a thread, forum or media channel

A user reacted to a message.

FieldTypeDescription
user_idsnowflakeUser that reacted
channel_idsnowflakeChannel the message is in
message_idsnowflakeMessage that was reacted to
emojireaction emoji objectThe emoji
guild_id?snowflakeGuild the channel belongs to
member?guild member objectThe reacting user's member object, in a guild channel
session_id?stringThe session that made the request, in a private channel
FieldTypeDescription
namestringUnicode emoji, or the custom emoji's name
id?snowflakeCustom emoji ID, absent for a Unicode emoji
animated?1booleanWhether the custom emoji is animated

1 Only on the first reaction with that emoji on the message. An absent animated does not mean false.

Reactions in private channels, grouped over 650 ms, for a session with the DEBOUNCE_MESSAGE_REACTIONS session flag. Each window keeps only the latest 512 reactions and drops older ones. Each event covers one message. A window with a single reaction sends Message Reaction Add.

FieldTypeDescription
channel_idsnowflakeChannel the message is in
message_idsnowflakeMessage that was reacted to
guild_id?snowflakeGuild the channel belongs to
reactionsarray[reaction addition object]The reactions, oldest first
FieldTypeDescription
user_idsnowflakeUser that reacted
emojireaction emoji objectThe emoji
member?guild member objectThe reacting user's member object, in a guild channel

A user's reaction was removed.

FieldTypeDescription
user_idsnowflakeUser whose reaction was removed
channel_idsnowflakeChannel the message is in
message_idsnowflakeMessage the reaction was on
emojireaction emoji objectThe emoji
guild_id?snowflakeGuild the channel belongs to
member?guild member objectThe user's member object, in a guild channel
session_id?stringThe session that made the request, in a private channel

Every reaction on a message was removed.

FieldTypeDescription
channel_idsnowflakeChannel the message is in
message_idsnowflakeMessage whose reactions were cleared
guild_id?snowflakeGuild the channel belongs to

Every reaction with one emoji was removed from a message.

FieldTypeDescription
channel_idsnowflakeChannel the message is in
message_idsnowflakeMessage the reactions were on
emojireaction emoji objectThe emoji whose reactions were removed
guild_id?snowflakeGuild the channel belongs to

A user started typing. Typing is decided separately explains which sessions get it.

FieldTypeDescription
channel_idsnowflakeChannel the user is typing in
user_idsnowflakeUser that started typing
timestampintegerUnix seconds when typing started
guild_id?snowflakeGuild the channel belongs to
member?guild member objectThe typing user's member object, in a guild channel

A channel's most recent pin time changed.

FieldTypeDescription
channel_idsnowflakeChannel whose pins changed
last_pin_timestamp?ISO8601 timestampTime of the most recent pin, null when nothing is pinned
guild_id?snowflakeGuild the channel belongs to

The current user marked a channel's pins as seen.

FieldTypeDescription
channel_idsnowflakeChannel whose pins were acknowledged
timestampISO8601 timestampTime the acknowledgement recorded

A participant's voice state changed. The payload is a voice state object, and a null channel_id means they left.

FieldTypeDescription
guild_id?snowflakeGuild the voice channel belongs to, null in a call
channel_id?snowflakeVoice channel, null when the participant left
user_id?snowflakeParticipant
connection_id?stringVoice connection ID
session_id?stringGateway session that owns the connection
member?guild member objectThe participant's member object, null in a call
mutebooleanServer mute
deafbooleanServer deafen
self_mutebooleanLocal microphone mute
self_deafbooleanLocal output deafen
self_videobooleanWhether the participant sends camera video
self_stream1booleanWhether the connection is sharing its screen
is_mobilebooleanWhether the participant is on a mobile app
suppressbooleanWhether the participant is suppressed
viewer_stream_keysarray[string]Streams this connection is watching
e2ee_capablebooleanWhether the participant's app supports end-to-end encrypted voice
p2pbooleanWhether this connection sends media peer-to-peer
versionintegerVersion of this participant's voice state, which only goes up

1 Always false in a guild voice channel when the participant lacks STREAM

The session got a voice grant, sent only to the session that asked. A LiveKit grant has token and endpoint. A peer-to-peer grant has p2p: true and ice_servers, and you follow Peer-to-peer voice. Voice has the rest.

FieldTypeDescription
token?1stringLiveKit access token
endpoint?1stringLiveKit ws:// or wss:// URL
p2p?2booleanAlways true when present
ice_servers?2array[ICE server object]STUN servers for the peer connections, empty when the instance has none
connection_idstringThe voice connection the grant is for
channel_idsnowflakeThe channel the grant is for
guild_id?snowflakeThe guild the channel belongs to, absent for a call
e2ee_key?3stringKey for the channel's end-to-end encryption

1 On a LiveKit grant

2 On a peer-to-peer grant

3 On a LiveKit grant for an end-to-end encrypted channel

A new grant comes when the connection opens, moves to another channel or changes region. A LiveKit grant for a connection that had a peer-to-peer grant means the call switched to LiveKit. Close your peer connections and connect with the new grant.

FieldTypeDescription
urlsarray[string]The stun: URLs of one server

Fluxer never gives out a TURN server, and peers that can't connect to each other directly can't call.

A voice channel or call is peer-to-peer when every voice state in it has p2p: true. Each pair of connections then has its own WebRTC peer connection and no media goes through LiveKit. Peers exchange session descriptions and ICE candidates with the Voice Signal command.

Fluxer decides each join from the channel's state and the p2p value in the Voice State Update command. A bot always counts as not sending p2p: true.

Channel or callThe command sent p2p: trueAny other p2p value
Peer-to-peer below the participant capPeer-to-peer join1Refused with VOICE_P2P_CONSENT_REQUIRED
Peer-to-peer at the participant capRefused with VOICE_CHANNEL_FULLRefused with VOICE_P2P_CONSENT_REQUIRED
EmptyPeer-to-peer join, or a LiveKit join when Fluxer declinesLiveKit join
Every other stateLiveKit joinLiveKit join

1 Refused with VOICE_P2P_UNAVAILABLE when Fluxer declines peer-to-peer for this join

A refusal arrives as a Gateway Error and changes nothing. On VOICE_P2P_CONSENT_REQUIRED, ask the user and send the join again with p2p: true if they agree. The participant cap is max_participants from the peer-to-peer voice configuration, between 2 and 4.

Fluxer never switches a call to LiveKit on its own. Only a participant sending p2p: false for its own connection, or a region change through Modify call region or Modify channel, switches it. The call stays on LiveKit until it empties. A guild voice channel with rtc_p2p set never switches.

Another connection in a peer-to-peer call sent this session a signaling message with the Voice Signal command. Only the session that owns the target connection receives it. Ignore a signal whose from is no longer in your roster.

FieldTypeDescription
guild_id?snowflakeThe guild the channel belongs to, absent for a call
channel_idsnowflakeThe voice channel or call channel
fromstringThe connection_id of the sender
user_idsnowflakeThe user who owns the sending connection
dataobjectThe signaling message exactly as the sender sent it
{
"guild_id": "1189375284394692608",
"channel_id": "1189375284394692610",
"from": "9a41d07c5be2f318",
"user_id": "1189375284394692700",
"data": {
"type": "answer",
"sdp": "v=0..."
}
}

A participant played their entrance sound in the voice channel they are in. Everyone else with a voice state in the channel receives it.

FieldTypeDescription
user_idsnowflakeParticipant whose sound plays
channel_idsnowflakeVoice channel
guild_id?snowflakeGuild the channel belongs to, null for a call
sound_idsnowflakeEntrance sound
hashstringContent hash of the sound file
urlstringURL to fetch the sound from
duration_msintegerSound duration in milliseconds
content_typestringMIME type of the sound file

A call started in a private channel, or the session learned of an active one after Ready or a lost connection. Every recipient of the channel receives it, and the same goes for Call Update and Call Delete.

FieldTypeDescription
channel_idsnowflakeChannel the call is in
message_idsnowflakeCall message that started the call
region?stringVoice region of the call, null until one is chosen
ringingarray[snowflake]Recipients being rung
voice_statesarray[voice state object]Participants
recipients?1array[snowflake]Every recipient of the channel
created_at?1integerUnix milliseconds when the call started

1 Only after Ready or a lost connection

Who is ringing, who is in the call or the call's region changed. The payload has the same fields as Call Create without recipients and created_at.

A call ended or became unavailable. Keep an unavailable call until a new Call Create arrives.

FieldTypeDescription
channel_idsnowflakeChannel the call was in
unavailable?booleanTrue when the call became unavailable, absent when it ended

The answer to Request Guild Counts. A guild that isn't connected or didn't answer in time has no entry.

FieldTypeDescription
countsarray[guild count entry object]One entry per guild
nonce?stringThe request's nonce
FieldTypeDescription
guild_idsnowflakeGuild the counts are for
member_countintegerTotal members
online_countintegerOnline members who share a channel you can view, or all of them for ADMINISTRATOR

The answer to Request Channel Member Counts. You only get an entry for a channel where you have VIEW_CHANNEL_MEMBERS.

FieldTypeDescription
countsarray[channel count entry object]One entry per channel
nonce?stringThe request's nonce
FieldTypeDescription
guild_idsnowflakeGuild the channel belongs to
channel_idsnowflakeChannel the counts are for
member_countintegerMembers who can view the channel
online_countintegerOnline members who can view the channel