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.
This commit is contained in:
Daniel 2019-04-09 00:05:40 -04:00 committed by Rapptz
parent db340fd5f9
commit 3a36f78e08

View File

@ -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():