Actually read from the voice websocket & fix heartbeat.

This change makes it so that the buffer doesn't fill and the voice server drops the socket.

Also, use correct interval for voice websocket heartbeat.
This commit is contained in:
Jake
2016-06-05 20:29:54 -07:00
parent b9c7b05176
commit 41a2b5ed73
2 changed files with 11 additions and 1 deletions

View File

@ -549,7 +549,7 @@ class DiscordVoiceWebSocket(websockets.client.WebSocketClientProtocol):
data = msg.get('d')
if op == self.READY:
interval = (data['heartbeat_interval'] / 100.0) - 5
interval = data['heartbeat_interval'] / 1000.0
self._keep_alive = VoiceKeepAliveHandler(ws=self, interval=interval)
self._keep_alive.start()
yield from self.initial_connection(data)