diff --git a/voice_recognition.py b/voice_recognition.py index ac2eb73..84c65b1 100644 --- a/voice_recognition.py +++ b/voice_recognition.py @@ -141,17 +141,9 @@ class Transcriber(commands.Cog): @commands.hybrid_command(name="transcribe") async def test(self, ctx): logger.info("Attempt transcribe") - if self.bot.voice_clients: - voice_client = self.bot.voice_clients[0] - if not voice_client.is_connected(): - logger.info("Connecting to voice") - voice_client = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient) - voice_client.listen(self.wsink) - else: - voice_client = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient) - - voice_client.listen(self.wsink) + vc = await ctx.author.voice.channel.connect(cls=voice_recv.VoiceRecvClient) logger.info("Connected") + vc.listen(self.wsink) @commands.command(name="stop_transcribe") async def stop(self, ctx):