Browse Source

Properly handle disconnects in voice when force disconnected

pull/5849/head
Rapptz 5 years ago
parent
commit
9036b9651b
  1. 8
      discord/voice_client.py

8
discord/voice_client.py

@ -252,8 +252,12 @@ class VoiceClient(VoiceProtocol):
if not self._handshaking: if not self._handshaking:
# If we're done handshaking then we just need to update ourselves # If we're done handshaking then we just need to update ourselves
guild = self.guild if channel_id is None:
self.channel = channel_id and guild and guild.get_channel(int(channel_id)) # We're being disconnected so cleanup
await self.disconnect()
else:
guild = self.guild
self.channel = channel_id and guild and guild.get_channel(int(channel_id))
else: else:
self._voice_state_complete.set() self._voice_state_complete.set()

Loading…
Cancel
Save