Skip to content

Commit

Permalink
Document get voice state endpoints (#7061)
Browse files Browse the repository at this point in the history
* Document get voice state endpoints

I also moved the modify voice state endpoints to the Voice page

* fix

* changelog

* Update docs/Change_Log.md

---------

Co-authored-by: shay <swdewael@gmail.com>
  • Loading branch information
advaith1 and shaydewael committed Aug 7, 2024
1 parent cc04e6e commit 072b4bc
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 43 deletions.
6 changes: 6 additions & 0 deletions docs/Change_Log.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## Voice State Endpoints

#### August 5, 2024

Voice states can now be accessed over the HTTP API! Apps can use the new [Get Current User Voice State](#DOCS_RESOURCES_VOICE/get-current-user-voice-state) and [Get User Voice State](#DOCS_RESOURCES_VOICE/get-user-voice-state) endpoints to fetch a user's voice state without a Gateway connection.

## Supported Activity Types for SET_ACTIVITY

#### July 25, 2024
Expand Down
43 changes: 0 additions & 43 deletions docs/resources/Guild.md
Original file line number Diff line number Diff line change
Expand Up @@ -1338,46 +1338,3 @@ Modifies the onboarding configuration of the guild. Returns a 200 with the [Onbo
| default_channel_ids | array of snowflakes | Channel IDs that members get opted into automatically |
| enabled | boolean | Whether onboarding is enabled in the guild |
| mode | [onboarding mode](#DOCS_RESOURCES_GUILD/guild-onboarding-object-onboarding-mode) | Current mode of onboarding |

## Modify Current User Voice State % PATCH /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/voice-states/@me

Updates the current user's voice state. Returns `204 No Content` on success. Fires a [Voice State Update](#DOCS_TOPICS_GATEWAY_EVENTS/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_id` must currently point to a stage channel.
- current user must already have joined `channel_id`.
- You must have the `MUTE_MEMBERS` permission to unsuppress yourself. You can always suppress yourself.
- You must have the `REQUEST_TO_SPEAK` permission to request to speak. You can always clear your own request to speak.
- You are able to set `request_to_speak_timestamp` to any present or future time.

## Modify User Voice State % PATCH /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/voice-states/{user.id#DOCS_RESOURCES_USER/user-object}

Updates another user's voice state. Fires a [Voice State Update](#DOCS_TOPICS_GATEWAY_EVENTS/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_id` must currently point to a stage channel.
- User must already have joined `channel_id`.
- You must have the `MUTE_MEMBERS` permission. (Since suppression is the only thing that is available currently.)
- When unsuppressed, non-bot users will have their `request_to_speak_timestamp` set to the current time. Bot users will not.
- When suppressed, the user will have their `request_to_speak_timestamp` removed.
51 changes: 51 additions & 0 deletions docs/resources/Voice.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,54 @@ Used to represent a user's voice connection status.
## List Voice Regions % GET /voice/regions

Returns an array of [voice region](#DOCS_RESOURCES_VOICE/voice-region-object) objects that can be used when setting a voice or stage channel's [`rtc_region`](#DOCS_RESOURCES_CHANNEL/channel-object-channel-structure).

## Get Current User Voice State % GET /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/voice-states/@me

Returns the current user's [voice state](#DOCS_RESOURCES_VOICE/voice-state-object) in the guild.

## Get User Voice State % GET /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/voice-states/{user.id#DOCS_RESOURCES_USER/user-object}

Returns the specified user's [voice state](#DOCS_RESOURCES_VOICE/voice-state-object) in the guild.

## Modify Current User Voice State % PATCH /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/voice-states/@me

Updates the current user's voice state. Returns `204 No Content` on success. Fires a [Voice State Update](#DOCS_TOPICS_GATEWAY_EVENTS/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_id` must currently point to a stage channel.
- current user must already have joined `channel_id`.
- You must have the `MUTE_MEMBERS` permission to unsuppress yourself. You can always suppress yourself.
- You must have the `REQUEST_TO_SPEAK` permission to request to speak. You can always clear your own request to speak.
- You are able to set `request_to_speak_timestamp` to any present or future time.

## Modify User Voice State % PATCH /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/voice-states/{user.id#DOCS_RESOURCES_USER/user-object}

Updates another user's voice state. Fires a [Voice State Update](#DOCS_TOPICS_GATEWAY_EVENTS/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_id` must currently point to a stage channel.
- User must already have joined `channel_id`.
- You must have the `MUTE_MEMBERS` permission. (Since suppression is the only thing that is available currently.)
- When unsuppressed, non-bot users will have their `request_to_speak_timestamp` set to the current time. Bot users will not.
- When suppressed, the user will have their `request_to_speak_timestamp` removed.

0 comments on commit 072b4bc

Please sign in to comment.