mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Properly handle disconnects in voice when force disconnected
This commit is contained in:
parent
9830e0ed8a
commit
9036b9651b
@ -96,7 +96,7 @@ class VoiceProtocol:
|
|||||||
The raw `voice state payload`__.
|
The raw `voice state payload`__.
|
||||||
|
|
||||||
.. _voice_state_update_payload: https://discord.com/developers/docs/resources/voice#voice-state-object
|
.. _voice_state_update_payload: https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||||
|
|
||||||
__ voice_state_update_payload_
|
__ voice_state_update_payload_
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
@ -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…
x
Reference in New Issue
Block a user