mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +00:00
Handle receiving HEARTBEAT opcode.
This commit is contained in:
parent
667d2b384b
commit
0c95edab8c
@ -303,6 +303,11 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
||||
if op == self.HEARTBEAT_ACK:
|
||||
return # disable noisy logging for now
|
||||
|
||||
if op == self.HEARTBEAT:
|
||||
beat = self._keep_alive.get_payload()
|
||||
yield from self.send_as_json(beat)
|
||||
return
|
||||
|
||||
if op == self.HELLO:
|
||||
interval = data['heartbeat_interval'] / 1000.0
|
||||
self._keep_alive = KeepAliveHandler(ws=self, interval=interval)
|
||||
|
Loading…
x
Reference in New Issue
Block a user