FIx: More robust opus loading code
This commit is contained in:
parent
eade77ffc3
commit
8ba7906e9f
|
@ -451,10 +451,15 @@ class Music(Cog):
|
||||||
|
|
||||||
logger.info("playing Player on the voice client")
|
logger.info("playing Player on the voice client")
|
||||||
self.h += [self.track]
|
self.h += [self.track]
|
||||||
if not discord.opus.is_loaded():
|
while not discord.opus.is_loaded():
|
||||||
|
for path in [
|
||||||
|
"/usr/lib/libopus.so",
|
||||||
|
"/usr/lib/libopus.so.0",
|
||||||
|
]:
|
||||||
try:
|
try:
|
||||||
discord.opus.load_opus("/usr/lib/libopus.so")
|
discord.opus.load_opus(path)
|
||||||
except:
|
except:
|
||||||
|
logger.warning(f"opus could not be loaded from {path} -- trying next?")
|
||||||
logger.error("opus could not be loaded!")
|
logger.error("opus could not be loaded!")
|
||||||
ctx.voice_client.play(
|
ctx.voice_client.play(
|
||||||
player,
|
player,
|
||||||
|
|
Loading…
Reference in a new issue