gateway.websocket: handle heartbeats when state is None

This commit is contained in:
Luna 2018-12-06 00:27:49 -03:00
parent 603a4757b4
commit 1abf57efef
1 changed files with 4 additions and 1 deletions

View File

@ -448,7 +448,10 @@ class GatewayWebsocket:
# close the websocket
self._hb_start((46 + 3) * 1000)
cliseq = payload.get('d')
self.state.last_seq = cliseq
if self.state:
self.state.last_seq = cliseq
await self.send_op(OP.HEARTBEAT_ACK, None)
async def _connect_ratelimit(self, user_id: int):