Discard null sequences in the gateway.
This was forbidding the Discord gateway from allowing us to RESUME properly, causing an over-abundance of READY being called.
This commit is contained in:
parent
b1117262da
commit
6306fc08db
@ -186,7 +186,7 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
|||||||
|
|
||||||
log.info('Created websocket connected to {}'.format(gateway))
|
log.info('Created websocket connected to {}'.format(gateway))
|
||||||
|
|
||||||
# poll the event for OP HELLO
|
# poll event for OP Hello
|
||||||
yield from ws.poll_event()
|
yield from ws.poll_event()
|
||||||
|
|
||||||
if not resume:
|
if not resume:
|
||||||
@ -289,9 +289,9 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
|||||||
|
|
||||||
op = msg.get('op')
|
op = msg.get('op')
|
||||||
data = msg.get('d')
|
data = msg.get('d')
|
||||||
|
seq = msg.get('s')
|
||||||
if 's' in msg:
|
if seq is not None:
|
||||||
state.sequence = msg['s']
|
state.sequence = seq
|
||||||
|
|
||||||
if op == self.RECONNECT:
|
if op == self.RECONNECT:
|
||||||
# "reconnect" can only be handled by the Client
|
# "reconnect" can only be handled by the Client
|
||||||
|
Loading…
x
Reference in New Issue
Block a user