Fix oversight where on_disconnect did not get called on WS termination.

This commit is contained in:
Rapptz
2019-04-08 07:43:55 -04:00
parent f8999b63ae
commit 61ee88b0fc
2 changed files with 3 additions and 0 deletions

View File

@ -382,6 +382,7 @@ class Client:
await self.ws.poll_event()
except ResumeWebSocket:
log.info('Got a request to RESUME the websocket.')
self.dispatch('disconnect')
coro = DiscordWebSocket.from_client(self, shard_id=self.shard_id, session=self.ws.session_id,
sequence=self.ws.sequence, resume=True)
self.ws = await asyncio.wait_for(coro, timeout=180.0, loop=self.loop)