From e5d202ad3d2049cf7b89fc23bcba04f20ea3b4ff Mon Sep 17 00:00:00 2001 From: mtuszowski Date: Fri, 20 Sep 2024 17:53:48 +0200 Subject: [PATCH] =?UTF-8?q?Last=20=C5=82an=20for=20todej=20mejbi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- voice_recognition.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/voice_recognition.py b/voice_recognition.py index 523ea9c..926b54b 100644 --- a/voice_recognition.py +++ b/voice_recognition.py @@ -129,12 +129,17 @@ class Transcriber(commands.Cog): self.comm_queue = asyncio.Queue() self.wsink = SRBuffer(self.comm_queue) self.worker = None + self.mc = None + self.vc = None @commands.hybrid_command(name="transcribe") async def test(self, ctx): logger.info("Attempt transcribe") - vc = None - + if self.vc: + vc = self.vc #to juz powinien byc voice channel z funkcja conenct + else: + vc = None + self.mc = ctx.message.channel if self.bot.voice_clients: if isinstance(self.bot.voice_clients[0], voice_recv.VoiceRecvClient): logger.info("Already transcribing") @@ -218,6 +223,7 @@ class Transcriber(commands.Cog): except Exception as e: logger.warn("Exceptiom occured %s", e) logger.info("Data sent") + await self.mc.send(("%s: %s", item.user, transcript.text)) if transcript.error: logger.error(transcript.error) raise AssertionError