From d534a0989e1c1080d7361bb872545468174580ba Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 18 Apr 2017 04:09:33 -0400 Subject: Properly cleanup of VoiceClients in cache. --- discord/shard.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'discord/shard.py') 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() -- cgit v1.2.3