Fix RESUME handling and make sure to wait 5 seconds before attempting.

This commit is contained in:
Rapptz 2017-04-22 21:36:29 -04:00
parent 6dca5035df
commit a76909e182

View File

@ -347,12 +347,14 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
return
if op == self.INVALIDATE_SESSION:
state.sequence = None
state.session_id = None
if data == True:
yield from asyncio.sleep(5.0, loop=self.loop)
yield from self.close()
raise ResumeWebSocket()
state.sequence = None
state.session_id = None
yield from self.identify()
return