From eade77ffc3566ee265987d12df2ca1ba83f2e0df Mon Sep 17 00:00:00 2001 From: a Date: Mon, 13 May 2024 05:27:28 +0000 Subject: [PATCH] Move opus fix to correct location? --- cogs/music.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cogs/music.py b/cogs/music.py index 24c2140..d029e3c 100644 --- a/cogs/music.py +++ b/cogs/music.py @@ -451,6 +451,11 @@ class Music(Cog): logger.info("playing Player on the voice client") self.h += [self.track] + if not discord.opus.is_loaded(): + try: + discord.opus.load_opus("/usr/lib/libopus.so") + except: + logger.error("opus could not be loaded!") ctx.voice_client.play( player, after=lambda e: self.after(ctx) @@ -528,11 +533,6 @@ class Music(Cog): # Ensure we are connected to voice if not ctx.voice_client: logger.warning("no voice client") - if not discord.opus.is_loaded(): - try: - discord.opus.load_opus("/usr/lib/libopus.so") - except: - logger.error("opus could not be loaded!") if ctx.author.voice: logger.info(f"moving voice client to {ctx.author.voice.channel}") await ctx.author.voice.channel.connect()