Fix: Try to load opus if it wasn't automatically loaded
This is necessary for musl-based systems like Alpine because ctypes.util.find_library('opus') will not find anything -- see https://bugs.python.org/issue21622 for more info
This commit is contained in:
parent
92766b83ff
commit
76c933bde1
|
@ -528,6 +528,11 @@ 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()
|
||||
|
|
Loading…
Reference in a new issue