From 33f8bdf95947664357d1a09fe39f2dab2b41ae83 Mon Sep 17 00:00:00 2001 From: SirTurlock <44070883+SirTurlock@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:35:25 +0200 Subject: [PATCH] fix: use int nonce for heartbeat instead of float for VoiceGateway (#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. --- interactions/api/voice/voice_gateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactions/api/voice/voice_gateway.py b/interactions/api/voice/voice_gateway.py index 670e139aa..c20c0560c 100644 --- a/interactions/api/voice/voice_gateway.py +++ b/interactions/api/voice/voice_gateway.py @@ -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: