Lobbies

Lobbies are groups of users that can communicate with each other via text and voice. Users can be in multiple lobbies at once. A lobby can also have metadata (an arbitrary JSON blob) associated with the lobby and each user.

Lobbies have a text chat channel that all members can use to communicate. Messages are sent to all members of the lobby. Lobbies support also voice calls. Although a lobby is allowed to have 1,000 members, you should not start voice calls in lobbies that large (around 25 is a good number).

Lobby Object

A game lobby within Discord.

Lobby Structure
FieldTypeDescription
idsnowflakeThe ID of the lobby
application_idsnowflakeThe ID of the application that created the lobby
metadata?map[string, string]The metadata of the lobby (max 25 keys, 1024 characters per key and value)
membersarray[lobby member object]The members of the lobby (max 1000)
flagsintegerThe lobby flags
linked_channel?channel objectThe guild channel linked to the lobby
Lobby Flags
ValueNameDescription
1 << 0REQUIRE_APPLICATION_AUTHORIZATIONUsers must authorize the application to send messages in the linked channel
Example Lobby Object
{
"id": "1350184413060661332",
"application_id": "891436243903728565",
"metadata": {
"topic": "balls"
},
"members": [
{
"id": "852892297661906993",
"metadata": null,
"flags": 1
}
]
}

Lobby Member Object

Represents a member of a lobby.

Lobby Member Structure
FieldTypeDescription
id 1snowflakeThe ID of the user
metadata??map[string, string]The metadata of the lobby member (max 25 keys, 1024 characters per key and value)
flags?integerThe lobby member's flags
connected 2booleanWhether the member is connected to a call in lobby

1 Not included when returned over the Gateway.

2 Only included in lobby objects returned over the Gateway.

Lobby Member Flags
ValueNameDescription
1 << 0CAN_LINK_LOBBYLobby member can link a text channel to the lobby

Endpoints

Create Lobby

POST/lobbies

Creates a new lobby. Returns a lobby object on success. Fires a Lobby Create Gateway event.

JSON Params
FieldTypeDescription
metadata??map[string, string]The metadata of the lobby (max 25 keys, 1024 characters per key and value)
members?array[partial lobby member object]The members of the lobby (max 25)
idle_timeout_seconds?integerHow long to wait (in seconds) before shutting down a lobby after it becomes idle (min 5, max 604800, default 300)
flags?integerThe lobby flags

Join or Create Lobby

PUT/lobbies

Joins an existing lobby or creates a new lobby. Returns a lobby object on success. May fire a Lobby Create or Lobby Member Add Gateway event.

JSON Params
FieldTypeDescription
secret 1stringThe lobby secret (max 250 characters)
lobby_metadata??map[string, string]The metadata of the lobby (max 25 keys, 1024 characters per key and value)
member_metadata??map[string, string]The metadata of the lobby member (max 25 keys, 1024 characters per key and value)
idle_timeout_seconds?integerHow long to wait (in seconds) before shutting down a lobby after it becomes idle (min 5, max 604800, default 300)
flags?integerThe lobby flags

1 Secret values expire after 30 days. After this time period, the lobby will still exist, but new users won't be able to join.

Get Lobby

GET/lobbies/{lobby.id}

Returns a lobby object for the given lobby ID. User must be a member of the lobby.

Modify Lobby

PATCH/lobbies/{lobby.id}

Modifies a lobby's settings. Application must be the creator of the lobby. Returns the updated lobby object on success. Fires a Lobby Update Gateway event.

JSON Params
FieldTypeDescription
metadata??map[string, string]The metadata of the lobby (max 25 keys, 1024 characters per key and value)
members?array[lobby member object]The members of the lobby (max 25)
idle_timeout_seconds?integerHow long to wait (in seconds) before shutting down a lobby after it becomes idle (min 5, max 604800)
flags?integerThe lobby flags

Delete Lobby

DELETE/lobbies/{lobby.id}

Deletes a lobby. Application must be the creator of the lobby. Returns a 204 empty response on success. Fires a Lobby Delete Gateway event.

Add Lobby Member

PUT/lobbies/{lobby.id}/members/{user.id}

Adds a member to the lobby. Returns the lobby member object. Fires a Lobby Member Add or Lobby Member Update Gateway event.

JSON Params
FieldTypeDescription
metadata??map[string, string]The metadata of the lobby member (max 25 keys, 1024 characters per key and value)
flags?integerThe lobby member's flags

Remove Lobby Member

DELETE/lobbies/{lobby.id}/members/{user.id}

Removes a member from the lobby. Returns a 204 empty response on success. Fires a Lobby Member Remove Gateway event.

Leave Lobby

DELETE/lobbies/{lobby.id}/members/@me

Removes the current user from the lobby. Returns a 204 empty response on success. Fires a Lobby Delete and Lobby Member Remove Gateway event.

Bulk Update Lobby Members

POST/lobbies/{lobby.id}/members/bulk

Modifies multiple members in a lobby in a single request. Accepts a list of 1 to 25 update lobby member objects. Returns a list of lobby member objects on success. May fire multiple Lobby Member Add, and/or Lobby Member Remove Gateway events.

Update Lobby Member Structure
FieldTypeDescription
idsnowflakeThe ID of the lobby member
metadata??map[string, string]The metadata of the lobby member (max 25 keys, 1024 characters per key and value)
flags?integerThe lobby member's flags
remove_member?booleanWhether to remove the member from the lobby

Create Lobby Invite for Current User

POST/lobbies/{lobby.id}/members/@me/invites

Creates an invite for the channel linked to the lobby that can only be accepted by the current user. Fires an Invite Create Gateway event.

Response Body
FieldTypeDescription
codestringThe code of the invite

Create Lobby Invite

POST/lobbies/{lobby.id}/members/{user.id}/invites

Creates an invite for the channel linked to the lobby that can only be accepted by the specified user. Fires an Invite Create Gateway event.

Response Body
FieldTypeDescription
codestringThe code of the invite

Modify Lobby Linked Channel

PATCH/lobbies/{lobby.id}/channel-linking

Links or unlinks a channel to the lobby. Returns a lobby object on success. Fires a Lobby Update and Channel Update Gateway event.

The application must be the creator of the lobby or the member must have the CAN_LINK_LOBBY flag. Requires the MANAGE_CHANNELS permission in the target channel.

JSON Params
FieldTypeDescription
channel_id??snowflakeThe ID of the channel to link to the lobby

Get Lobby Messages

GET/lobbies/{lobby.id}/messages

Returns a list of partial message objects in the lobby in reverse chronological order.

Query String Params
FieldTypeDescription
limit?integerMax number of messages to return (1-200, default 50)

Create Lobby Message

POST/lobbies/{lobby.id}/messages

Posts a message to a lobby. Returns a partial message object on success. Fires a Lobby Message Create and Message Create Gateway event. Functionally identical to the Create Message endpoint, but is used for lobbies in an OAuth2 context and has some additional parameters. Check there for more information.

Extra JSON Params
FieldTypeDescription
metadata?objectCustom metadata for the message (max 25 keys, 1024 characters per key and value)

Update Lobby Message Moderation Metadata

PUT/lobbies/{lobby.id}/messages/{message.id}/moderation-metadata

Updates a lobby message's moderation metadata. Accepts a moderation metadata mapping, up to 5 keys, max 2000 characters per value. Returns a 204 empty response. Fires a Lobby Message Update or Message Update Gateway event.