From 4184cbb687a53e243fbf0ce2ac48dd1d9119e5ca Mon Sep 17 00:00:00 2001 From: mtuszowski Date: Fri, 20 Sep 2024 15:48:00 +0200 Subject: [PATCH] Fix --- voice_recognition.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/voice_recognition.py b/voice_recognition.py index 4ffecf3..579b594 100644 --- a/voice_recognition.py +++ b/voice_recognition.py @@ -154,6 +154,7 @@ class Transcriber(commands.Cog): logger.info("Connected") vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient) logger.info(self.bot.voice_clients) + self.check_data.start() self.worker.start() vc.listen(self.wsink) @@ -199,13 +200,15 @@ class Transcriber(commands.Cog): @commands.command(name="stop_transcribe") async def stop(self, ctx): self.check_data.stop() - self.worker.stop() + self.comm_queue.put("STOP") await ctx.voice_client.disconnect() def transcribe_output_queue(queue): logger.info("Worker start") while True: - queue.get() + item = queue.get() + if item == "STOP": + break logger.info("PING") async def setup(bot):