mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-12-01 18:02:21 +00:00
Add VoiceClient.is_paused to query pause state.
This commit is contained in:
1 parent
55e63ed87f
commit
07d5328873
2 files changed
+7
No files matched your search
@@ -252,3 +252,6 @@ class AudioPlayer(threading.Thread):
|
|||||||
|
|
||||||
def is_playing(self):
|
def is_playing(self):
|
||||||
return self._resumed.is_set() and not self._end.is_set()
|
return self._resumed.is_set() and not self._end.is_set()
|
||||||
|
|
||||||
|
def is_paused(self):
|
||||||
|
return not self._end.is_set() and not self._resumed.is_set()
|
||||||
@@ -337,6 +337,10 @@ class VoiceClient:
|
|||||||
"""Indicates if we're currently playing audio."""
|
"""Indicates if we're currently playing audio."""
|
||||||
return self._player is not None and self._player.is_playing()
|
return self._player is not None and self._player.is_playing()
|
||||||
|
|
||||||
|
def is_paused(self):
|
||||||
|
"""Indicates if we're playing audio, but if we're paused."""
|
||||||
|
return self._player is not None and self._player.is_paused()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stops playing audio."""
|
"""Stops playing audio."""
|
||||||
if self._player:
|
if self._player:
|
||||||
|
|||||||
Reference in new issue
Block a user