mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
Properly cleanup of VoiceClients in cache.
This commit is contained in:
parent
65bd510df6
commit
d534a0989e
@ -429,15 +429,13 @@ class Client:
|
||||
|
||||
self._closed.set()
|
||||
|
||||
for voice in list(self.voice_clients):
|
||||
for voice in self.voice_clients:
|
||||
try:
|
||||
yield from voice.disconnect()
|
||||
except:
|
||||
# if an error happens during disconnects, disregard it.
|
||||
pass
|
||||
|
||||
self.connection._remove_voice_client(voice.guild.id)
|
||||
|
||||
if self.ws is not None and self.ws.open:
|
||||
yield from self.ws.close()
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user