From 8b134ddcc9f49787a4c53e93bc0d966283f66983 Mon Sep 17 00:00:00 2001 From: mtuszowski Date: Thu, 19 Sep 2024 16:44:09 +0200 Subject: [PATCH] Fix --- voice_recognition.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/voice_recognition.py b/voice_recognition.py index 56c3553..234ebf2 100644 --- a/voice_recognition.py +++ b/voice_recognition.py @@ -159,11 +159,18 @@ class Transcriber(commands.Cog): async def test(self, ctx): logger.info("Attempt transcribe") vc = None - logger.info(self.bot.voice_clients) - logger.info("Connected") - vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient) - logger.info(self.bot.voice_clients) - vc.listen(self.wsink) + if self.bot.voice_clients: + if isinstance(self.bot.voicce_clients[0], voice_recv.VoiceRecvClient): + logger.info("Already transcribing") + else: + logger.info("Already connected with other client") + logger.info(self.bot.voice_clients) + + else: + logger.info("Connected") + vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient) + logger.info(self.bot.voice_clients) + vc.listen(self.wsink) @commands.command(name="stop_transcribe") async def stop(self, ctx):