aboutsummaryrefslogtreecommitdiff
path: root/discord/shard.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-04-08 07:43:55 -0400
committerRapptz <[email protected]>2019-04-08 07:45:05 -0400
commit61ee88b0fc48ba2bfc479bccec0e99a92c05fa1d (patch)
treed98847fb17a444a2231077f4c0c849421591026d /discord/shard.py
parentFix long-standing issue with user updates not dispatching properly. (diff)
downloaddiscord.py-61ee88b0fc48ba2bfc479bccec0e99a92c05fa1d.tar.xz
discord.py-61ee88b0fc48ba2bfc479bccec0e99a92c05fa1d.zip
Fix oversight where on_disconnect did not get called on WS termination.
Diffstat (limited to 'discord/shard.py')
-rw-r--r--discord/shard.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/shard.py b/discord/shard.py
index 3bf3788b..b15b22a2 100644
--- a/discord/shard.py
+++ b/discord/shard.py
@@ -43,6 +43,7 @@ class Shard:
def __init__(self, ws, client):
self.ws = ws
self._client = client
+ self._dispatch = client.dispatch
self.loop = self._client.loop
self._current = self.loop.create_future()
self._current.set_result(None) # we just need an already done future
@@ -79,6 +80,7 @@ class Shard:
log.info('Got a request to RESUME the websocket at Shard ID %s.', self.id)
coro = DiscordWebSocket.from_client(self._client, resume=True, shard_id=self.id,
session=self.ws.session_id, sequence=self.ws.sequence)
+ self._dispatch('disconnect')
self.ws = await asyncio.wait_for(coro, timeout=180.0, loop=self.loop)
def get_future(self):