From 2339a21639e79ba7f6ecb334d65d1857b2490733 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 8 Apr 2026 16:21:49 +0200 Subject: "fix" voice management --- cogs/voice.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cogs/voice.py') diff --git a/cogs/voice.py b/cogs/voice.py index 8ee3699..316de7b 100644 --- a/cogs/voice.py +++ b/cogs/voice.py @@ -69,6 +69,21 @@ class VoiceManager: """Get existing voice client for a guild.""" return discord.utils.get(self.bot.voice_clients, guild=guild) + async def get_voice_status(self, guild): + """Get voice client status including connection and playback state. + + Returns: + tuple: (voice_client, is_connected, is_playing) or (None, False, False) if no client + """ + voice_client = await self.get_voice_client(guild) + if voice_client is None: + return None, False, False + + is_connected = voice_client.is_connected() + is_playing = voice_client.is_playing() if is_connected else False + + return voice_client, is_connected, is_playing + async def play_audio(self, channel, audio_source, volume=1.0): """Play audio in a voice channel.""" voice_client = await self.join_channel(channel) -- cgit v1.2.3