From 55e63ed87fdf7eb18fe16f612e38e0739ddc0a74 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 19 Apr 2017 01:19:39 -0400 Subject: [PATCH] Add VoiceClient.source to get the AudioSource being played. --- discord/voice_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discord/voice_client.py b/discord/voice_client.py index bf8575720..a363586c3 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.