mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-10 13:35:40 +00:00
Raise ResumeWebsocket in case of RECONNECT
This commit is contained in:
parent
192f57efef
commit
1cd50919a1
@ -45,10 +45,6 @@ __all__ = [ 'ReconnectWebSocket', 'DiscordWebSocket',
|
|||||||
'KeepAliveHandler', 'VoiceKeepAliveHandler',
|
'KeepAliveHandler', 'VoiceKeepAliveHandler',
|
||||||
'DiscordVoiceWebSocket', 'ResumeWebSocket' ]
|
'DiscordVoiceWebSocket', 'ResumeWebSocket' ]
|
||||||
|
|
||||||
class ReconnectWebSocket(Exception):
|
|
||||||
"""Signals to handle the RECONNECT opcode."""
|
|
||||||
pass
|
|
||||||
|
|
||||||
class ResumeWebSocket(Exception):
|
class ResumeWebSocket(Exception):
|
||||||
"""Signals to initialise via RESUME opcode instead of IDENTIFY."""
|
"""Signals to initialise via RESUME opcode instead of IDENTIFY."""
|
||||||
pass
|
pass
|
||||||
@ -339,7 +335,7 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
|||||||
# internal exception signalling to reconnect.
|
# internal exception signalling to reconnect.
|
||||||
log.info('Received RECONNECT opcode.')
|
log.info('Received RECONNECT opcode.')
|
||||||
yield from self.close()
|
yield from self.close()
|
||||||
raise ReconnectWebSocket()
|
raise ResumeWebsocket()
|
||||||
|
|
||||||
if op == self.HEARTBEAT_ACK:
|
if op == self.HEARTBEAT_ACK:
|
||||||
self._keep_alive.ack()
|
self._keep_alive.ack()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user