Voice State Object
Used to represent a user’s voice connection status.Voice State Structure
| Field | Type | Description | 
|---|---|---|
| guild_id? | snowflake | the guild id this voice state is for | 
| channel_id | ?snowflake | the channel id this user is connected to | 
| user_id | snowflake | the user id this voice state is for | 
| member? | guild member object | the guild member this voice state is for | 
| session_id | string | the session id for this voice state | 
| deaf | boolean | whether this user is deafened by the server | 
| mute | boolean | whether this user is muted by the server | 
| self_deaf | boolean | whether this user is locally deafened | 
| self_mute | boolean | whether this user is locally muted | 
| self_stream? | boolean | whether this user is streaming using “Go Live” | 
| self_video | boolean | whether this user’s camera is enabled | 
| suppress | boolean | whether this user’s permission to speak is denied | 
| request_to_speak_timestamp | ?ISO8601 timestamp | the time at which the user requested to speak | 
Example Voice State
Voice Region Object
Voice Region Structure
| Field | Type | Description | 
|---|---|---|
| id | string | unique ID for the region | 
| name | string | name of the region | 
| optimal | boolean | true for a single server that is closest to the current user’s client | 
| deprecated | boolean | whether this is a deprecated voice region (avoid switching to these) | 
| custom | boolean | whether this is a custom voice region (used for events/etc) | 
List Voice Regions
GET/voice/regions
Returns an array of voice region objects that can be used when setting a voice or stage channel’s rtc_region.
Get Current User Voice State
GET/guilds/{guild.id}/voice-states/@me
Returns the current user’s voice state in the guild.
Get User Voice State
GET/guilds/{guild.id}/voice-states/{user.id}
Returns the specified user’s voice state in the guild.
Modify Current User Voice State
PATCH/guilds/{guild.id}/voice-states/@me
Updates the current user’s voice state. Returns 204 No Content on success. Fires a Voice State Update Gateway event.
JSON Params
| Field | Type | Description | 
|---|---|---|
| channel_id? | snowflake | the id of the channel the user is currently in | 
| suppress? | boolean | toggles the user’s suppress state | 
| request_to_speak_timestamp? | ?ISO8601 timestamp | sets the user’s request to speak | 
Caveats
There are currently several caveats for this endpoint:- channel_idmust currently point to a stage channel.
- current user must already have joined channel_id.
- You must have the MUTE_MEMBERSpermission to unsuppress yourself. You can always suppress yourself.
- You must have the REQUEST_TO_SPEAKpermission to request to speak. You can always clear your own request to speak.
- You are able to set request_to_speak_timestampto any present or future time.
Modify User Voice State
PATCH/guilds/{guild.id}/voice-states/{user.id}
Updates another user’s voice state. Returns 204 No Content on success. Fires a Voice State Update Gateway event.
JSON Params
| Field | Type | Description | 
|---|---|---|
| channel_id? | snowflake | the id of the channel the user is currently in | 
| suppress? | boolean | toggles the user’s suppress state | 
Caveats
There are currently several caveats for this endpoint:- channel_idmust currently point to a stage channel.
- User must already have joined channel_id.
- You must have the MUTE_MEMBERSpermission. (Since suppression is the only thing that is available currently.)
- When unsuppressed, non-bot users will have their request_to_speak_timestampset to the current time. Bot users will not.
- When suppressed, the user will have their request_to_speak_timestampremoved.