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:
parent
db340fd5f9
commit
3a36f78e08
@ -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…
x
Reference in New Issue
Block a user