Browse Source

Update last_send when receiving a HEARTBEAT request

pull/10406/head
Rapptz 4 months ago
parent
commit
f780f04447
  1. 6
      discord/gateway.py

6
discord/gateway.py

@ -210,6 +210,10 @@ class KeepAliveHandler(threading.Thread):
def tick(self) -> None:
self._last_recv = time.perf_counter()
def beat(self) -> Dict[str, Any]:
self._last_send = time.perf_counter()
return self.get_payload()
def ack(self) -> None:
ack_time = time.perf_counter()
self._last_ack = ack_time
@ -541,7 +545,7 @@ class DiscordWebSocket:
if op == self.HEARTBEAT:
if self._keep_alive:
beat = self._keep_alive.get_payload()
beat = self._keep_alive.beat()
await self.send_as_json(beat)
return

Loading…
Cancel
Save