Skip to content

[Voice] Clarified documentation on how to disconnect #7444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/topics/voice-connections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,20 @@ Generally routers on the Internet mask or obfuscate UDP ports through a process
| SSRC | Unsigned integer | 4 bytes |
| Address | Null-terminated string in response | 64 bytes |
| Port | Unsigned short | 2 bytes |

## Disconnecting from Voice

To disconnect from the voice channel, you must first close the UDP and WebSocket connections. Then, we need to send an [Opcode 4 Gateway Voice State Update](#DOCS_TOPICS_OPCODES_AND_STATUS_CODES/gateway) payload with the channel ID set to null.

###### Gateway Voice State Update to Disconnect Example

```json
{
"op": 4,
"d": {
"guild_id": "41771983423143937",
"channel_id": null
}
}
```
This will disconnect the bot from the voice channel that it is in within that guild.