From 07d53288737e4eeb8a0e21c339d4b929bb97ce35 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 19 Apr 2017 16:06:45 -0400 Subject: [PATCH] Add VoiceClient.is_paused to query pause state. --- discord/player.py | 3 +++ discord/voice_client.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/discord/player.py b/discord/player.py index 3ed7fb7d8..4385a6df2 100644 --- a/discord/player.py +++ b/discord/player.py @@ -252,3 +252,6 @@ class AudioPlayer(threading.Thread): def is_playing(self): 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() diff --git a/discord/voice_client.py b/discord/voice_client.py index a363586c3..64dd65380 100644 --- a/discord/voice_client.py +++ b/discord/voice_client.py @@ -337,6 +337,10 @@ class VoiceClient: """Indicates if we're currently playing audio.""" 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): """Stops playing audio.""" if self._player: