Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ 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).
([#1955](https://github.com/Pycord-Development/pycord/pull/1955))

## [2.4.0] - 2023-02-10

Expand Down
8 changes: 4 additions & 4 deletions discord/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down