Skip to content

Commit

Permalink
fix: use int nonce for heartbeat instead of float for VoiceGateway (#…
Browse files Browse the repository at this point in the history
…1727)

Fixes #1726
VoiceGateway no longer accepts a string or a float in the heartbeat nonce and instead immediately disconnects the client with code 4020.
Fixed send_heartbeat to use an uint64 instead of a float for the nonce.
  • Loading branch information
SirTurlock authored Aug 12, 2024
1 parent ecf7b9e commit 33f8bdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion interactions/api/voice/voice_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def send_packet(self, data: bytes, encoder, needs_encode=True) -> None:
self.timestamp += encoder.samples_per_frame

async def send_heartbeat(self) -> None:
await self.send_json({"op": OP.HEARTBEAT, "d": random.uniform(0.0, 1.0)})
await self.send_json({"op": OP.HEARTBEAT, "d": random.getrandbits(64)})
self.logger.debug("❤ Voice Connection is sending Heartbeat")

async def _identify(self) -> None:
Expand Down

0 comments on commit 33f8bdf

Please sign in to comment.