Properly cleanup of VoiceClients in cache.

This commit is contained in:
Rapptz committed 2017-04-18 04:09:33 -04:00
1 parent 65bd510df6
commit d534a0989e
2 files changed
+7 -3

No files matched your search

+6
View File
@@ -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()