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
| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the lobby |
| application_id | snowflake | The 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) |
| members | array[lobby member object] | The members of the lobby (max 1000) |
| flags | integer | The lobby flags |
| linked_channel? | channel object | The guild channel linked to the lobby |
Lobby Flags
| Value | Name | Description |
|---|---|---|
| 1 << 0 | REQUIRE_APPLICATION_AUTHORIZATION | Users 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
| Field | Type | Description |
|---|---|---|
| id 1 | snowflake | The ID of the user |
| metadata? | ?map[string, string] | The metadata of the lobby member (max 25 keys, 1024 characters per key and value) |
| flags? | integer | The lobby member's flags |
| connected 2 | boolean | Whether 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
| Value | Name | Description |
|---|---|---|
| 1 << 0 | CAN_LINK_LOBBY | Lobby member can link a text channel to the lobby |
Endpoints
Create Lobby
POST/lobbiesCreates a new lobby. Returns a lobby object on success. Fires a Lobby Create Gateway event.
JSON Params
| Field | Type | Description |
|---|---|---|
| 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? | integer | How long to wait (in seconds) before shutting down a lobby after it becomes idle (min 5, max 604800, default 300) |
| flags? | integer | The lobby flags |
Join or Create Lobby
PUT/lobbiesJoins 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
| Field | Type | Description |
|---|---|---|
| secret 1 | string | The 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? | integer | How long to wait (in seconds) before shutting down a lobby after it becomes idle (min 5, max 604800, default 300) |
| flags? | integer | The 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
| Field | Type | Description |
|---|---|---|
| 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? | integer | How long to wait (in seconds) before shutting down a lobby after it becomes idle (min 5, max 604800) |
| flags? | integer | The 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
| Field | Type | Description |
|---|---|---|
| metadata? | ?map[string, string] | The metadata of the lobby member (max 25 keys, 1024 characters per key and value) |
| flags? | integer | The 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/@meRemoves 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/bulkModifies 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
| Field | Type | Description |
|---|---|---|
| id | snowflake | The 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? | integer | The lobby member's flags |
| remove_member? | boolean | Whether to remove the member from the lobby |
Create Lobby Invite for Current User
POST/lobbies/{lobby.id}/members/@me/invitesCreates 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
| Field | Type | Description |
|---|---|---|
| code | string | The code of the invite |
Create Lobby Invite
POST/lobbies/{lobby.id}/members/{user.id}/invitesCreates 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
| Field | Type | Description |
|---|---|---|
| code | string | The code of the invite |
Modify Lobby Linked Channel
PATCH/lobbies/{lobby.id}/channel-linkingLinks 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
| Field | Type | Description |
|---|---|---|
| channel_id? | ?snowflake | The ID of the channel to link to the lobby |
Get Lobby Messages
GET/lobbies/{lobby.id}/messagesReturns a list of partial message objects in the lobby in reverse chronological order.
Query String Params
| Field | Type | Description |
|---|---|---|
| limit? | integer | Max number of messages to return (1-200, default 50) |
Create Lobby Message
POST/lobbies/{lobby.id}/messagesPosts 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
| Field | Type | Description |
|---|---|---|
| metadata? | object | Custom 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-metadataUpdates 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.