aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-04-19 01:19:39 -0400
committerRapptz <[email protected]>2017-04-19 01:19:39 -0400
commit55e63ed87fdf7eb18fe16f612e38e0739ddc0a74 (patch)
treeeed6e4799638d585f79e25c2944665974f43c4cd
parentFix static cut-off when playing. (diff)
downloaddiscord.py-55e63ed87fdf7eb18fe16f612e38e0739ddc0a74.tar.xz
discord.py-55e63ed87fdf7eb18fe16f612e38e0739ddc0a74.zip
Add VoiceClient.source to get the AudioSource being played.
-rw-r--r--discord/voice_client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/voice_client.py b/discord/voice_client.py
index bf857572..a363586c 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -353,6 +353,11 @@ class VoiceClient:
if self._player:
self._player.resume()
+ @property
+ def source(self):
+ """Optional[:class:`AudioSource`]: The audio source being played, if playing."""
+ return self._player.source if self._player else None
+
def send_audio_packet(self, data, *, encode=True):
"""Sends an audio packet composed of the data.