From 77e6c02ab7cfe89c03f33ffaa81efabd2cdbb7ba Mon Sep 17 00:00:00 2001 From: Samlon Date: Mon, 11 Aug 2025 20:28:20 +0200 Subject: revert voice changes --- cogs/vclogs.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'cogs/vclogs.py') diff --git a/cogs/vclogs.py b/cogs/vclogs.py index 64c356d..a9672ac 100644 --- a/cogs/vclogs.py +++ b/cogs/vclogs.py @@ -50,22 +50,11 @@ class VcLogs(commands.Cog): tts = gTTS(text=text, lang='pl') tts.save('temp_tts.mp3') - # Get the voice client for the guild + # Connect to the voice channel if not already connected voice_client = discord.utils.get(self.bot.voice_clients, guild=channel.guild) - - # Handle connection state if not voice_client or not voice_client.is_connected(): - # If no voice client or not connected, create a new connection - try: - voice_client = await channel.connect() - except discord.ClientException as e: - if 'already connected' in str(e).lower(): - # If already connected, find the existing connection - voice_client = next((vc for vc in self.bot.voice_clients if vc.guild == channel.guild), None) - else: - raise + voice_client = await channel.connect() elif voice_client.channel != channel: - # If connected to a different channel, move to the new one await voice_client.move_to(channel) # Play the TTS audio -- cgit v1.2.3