aboutsummaryrefslogtreecommitdiff
path: root/discord/shard.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-04-18 04:09:33 -0400
committerRapptz <[email protected]>2017-04-18 04:09:33 -0400
commitd534a0989e1c1080d7361bb872545468174580ba (patch)
tree67e40618de03cd429462cd51470515884b93daf7 /discord/shard.py
parentAdd Guild.voice_client shortcut. (diff)
downloaddiscord.py-d534a0989e1c1080d7361bb872545468174580ba.tar.xz
discord.py-d534a0989e1c1080d7361bb872545468174580ba.zip
Properly cleanup of VoiceClients in cache.
Diffstat (limited to 'discord/shard.py')
-rw-r--r--discord/shard.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/discord/shard.py b/discord/shard.py
index d3d54ab5..7937e375 100644
--- a/discord/shard.py
+++ b/discord/shard.py
@@ -240,6 +240,12 @@ class AutoShardedClient(Client):
self._closed.set()
+ for vc in self.voice_clients:
+ try:
+ yield from vc.disconnect()
+ except:
+ pass
+
to_close = [shard.ws.close() for shard in self.shards.values()]
yield from asyncio.wait(to_close, loop=self.loop)
yield from self.http.close()