Browse Source

Use is_connected() instead of _connected in checks

Was doing a falsy check on an Event object instead of using the (unused) is_connected() function.
pull/2057/head
Daniel 6 years ago
committed by Rapptz
parent
commit
3a36f78e08
  1. 4
      discord/voice_client.py

4
discord/voice_client.py

@ -261,7 +261,7 @@ class VoiceClient:
Disconnects this voice client from voice. Disconnects this voice client from voice.
""" """
if not force and not self._connected.is_set(): if not force and not self.is_connected():
return return
self.stop() self.stop()
@ -348,7 +348,7 @@ class VoiceClient:
source is not a :class:`AudioSource` or after is not a callable. source is not a :class:`AudioSource` or after is not a callable.
""" """
if not self._connected: if not self.is_connected():
raise ClientException('Not connected to voice.') raise ClientException('Not connected to voice.')
if self.is_playing(): if self.is_playing():

Loading…
Cancel
Save