From 05926f3b3cae1789266c3e2ea99ea8bbd4a2742d Mon Sep 17 00:00:00 2001 From: George <81972974+seailz@users.noreply.github.com> Date: Tue, 1 Apr 2025 21:10:35 +0100 Subject: [PATCH] Update voice-connections.mdx --- docs/topics/voice-connections.mdx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/topics/voice-connections.mdx b/docs/topics/voice-connections.mdx index 6b6b4b35e8..178f3b75d7 100644 --- a/docs/topics/voice-connections.mdx +++ b/docs/topics/voice-connections.mdx @@ -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.