From 43c090f8d9ff337e4137ebf0ef298db00015f852 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Wed, 1 Mar 2023 23:54:23 +0000 Subject: [PATCH 1/5] fix: ip discovery changes (74 byte udp packets) --- CHANGELOG.md | 2 ++ discord/gateway.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a4edb7d3..f6352e1db7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `SlashCommandGroup.walk_commands()` to reflect actual behavior. ([#1852](https://github.com/Pycord-Development/pycord/pull/1852)) +- Fixed the voice ip discovery due to recent [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486) + ([#1954](https://github.com/Pycord-Development/pycord/pull/1954)) ## [2.4.0] - 2023-02-10 diff --git a/discord/gateway.py b/discord/gateway.py index d337dda69f..bd13f22e46 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -892,16 +892,16 @@ async def initial_connection(self, data): state.voice_port = data["port"] state.endpoint_ip = data["ip"] - packet = bytearray(70) + packet = bytearray(74) struct.pack_into(">H", packet, 0, 1) # 1 = Send struct.pack_into(">H", packet, 2, 70) # 70 = Length struct.pack_into(">I", packet, 4, state.ssrc) state.socket.sendto(packet, (state.endpoint_ip, state.voice_port)) - recv = await self.loop.sock_recv(state.socket, 70) + recv = await self.loop.sock_recv(state.socket, 74) _log.debug("received packet in initial_connection: %s", recv) - # the ip is ascii starting at the 4th byte and ending at the first null - ip_start = 4 + # the ip is ascii starting at the 8th byte and ending at the first null + ip_start = 8 ip_end = recv.index(0, ip_start) state.ip = recv[ip_start:ip_end].decode("ascii") From 7a4a7e0f862eeed20cc21dffe93c4e1916ddbbf0 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Wed, 1 Mar 2023 23:55:09 +0000 Subject: [PATCH 2/5] chore: Pr will be 1955 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6352e1db7..0747603406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `SlashCommandGroup.walk_commands()` to reflect actual behavior. ([#1852](https://github.com/Pycord-Development/pycord/pull/1852)) - Fixed the voice ip discovery due to recent [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486) - ([#1954](https://github.com/Pycord-Development/pycord/pull/1954)) + ([#1955](https://github.com/Pycord-Development/pycord/pull/1955)) ## [2.4.0] - 2023-02-10 From 030a9a5083f2f216f96b95659ae94446271ff9ac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 23:55:38 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0747603406..7f9580a221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `SlashCommandGroup.walk_commands()` to reflect actual behavior. ([#1852](https://github.com/Pycord-Development/pycord/pull/1852)) -- Fixed the voice ip discovery due to recent [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486) +- Fixed the voice ip discovery due to recent + [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486) ([#1955](https://github.com/Pycord-Development/pycord/pull/1955)) ## [2.4.0] - 2023-02-10 From 2573a5273a740b9c4a8c31550c3609863b4a63db Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Thu, 2 Mar 2023 00:57:04 +0100 Subject: [PATCH 4/5] Update CHANGELOG.md Signed-off-by: Lala Sabathil --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f9580a221..a3fa31e61c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `SlashCommandGroup.walk_commands()` to reflect actual behavior. ([#1852](https://github.com/Pycord-Development/pycord/pull/1852)) -- Fixed the voice ip discovery due to recent +- Fixed the voice ip discovery due to the recent [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486) ([#1955](https://github.com/Pycord-Development/pycord/pull/1955)) From 3edc12fb7ebbcb3d8958828345f70c3cc8185c30 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Thu, 2 Mar 2023 04:16:56 +0100 Subject: [PATCH 5/5] Update CHANGELOG.md Co-authored-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com> Signed-off-by: Lala Sabathil --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3fa31e61c..c717c55347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed the type-hinting of `SlashCommandGroup.walk_commands()` to reflect actual behavior. ([#1852](https://github.com/Pycord-Development/pycord/pull/1852)) - Fixed the voice ip discovery due to the recent - [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486) + [announced change](https://discord.com/channels/613425648685547541/697138785317814292/1080623873629884486). ([#1955](https://github.com/Pycord-Development/pycord/pull/1955)) ## [2.4.0] - 2023-02-10