Actually resume on opcode RECONNECT

This commit is contained in:
Anis B 2017-10-11 05:14:57 +02:00 committed by GitHub
parent d50acf79f8
commit 192f57efef

View File

@ -447,9 +447,8 @@ class Client:
try: try:
yield from self.ws.poll_event() yield from self.ws.poll_event()
except (ReconnectWebSocket, ResumeWebSocket) as e: except (ReconnectWebSocket, ResumeWebSocket) as e:
resume = type(e) is ResumeWebSocket
log.info('Got ' + type(e).__name__) log.info('Got ' + type(e).__name__)
self.ws = yield from DiscordWebSocket.from_client(self, resume=resume) self.ws = yield from DiscordWebSocket.from_client(self, resume=True)
except ConnectionClosed as e: except ConnectionClosed as e:
yield from self.close() yield from self.close()
if e.code != 1000: if e.code != 1000: