mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-14 17:59:48 +00:00
Close voice connections before closing the websocket.
This commit is contained in:
parent
c2e7a68105
commit
8f4816ddae
@ -418,12 +418,18 @@ class Client:
|
||||
if self.is_closed:
|
||||
return
|
||||
|
||||
for voice in list(self.voice_clients):
|
||||
try:
|
||||
yield from voice.disconnect()
|
||||
except:
|
||||
# if an error happens during disconnects, disregard it.
|
||||
pass
|
||||
|
||||
self.connection._remove_voice_client(voice.server.id)
|
||||
|
||||
if self.ws is not None and self.ws.open:
|
||||
yield from self.ws.close()
|
||||
|
||||
for voice in list(self.voice_clients):
|
||||
yield from voice.disconnect()
|
||||
self.connection._remove_voice_client(voice.server.id)
|
||||
|
||||
yield from self.session.close()
|
||||
self._closed.set()
|
||||
|
Loading…
x
Reference in New Issue
Block a user