mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
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:
@ -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():
|
||||||
|
Reference in New Issue
Block a user