Compare commits

...

2 Commits

2 changed files with 11 additions and 12 deletions

View File

@@ -19,7 +19,8 @@ async def cleanup():
targets.append(guild_id) targets.append(guild_id)
for target in targets: for target in targets:
del players[target] del players[target]
debug(f"cleanup thread removed {len(targets)} empty players") if len(targets):
debug(f"cleanup thread removed {len(targets)} empty players")
if ( if (
not idle_tracker["is_idle"] not idle_tracker["is_idle"]

View File

@@ -1,5 +1,6 @@
import ctypes
import time import time
from logging import error, info from logging import debug, error
from pathlib import Path from pathlib import Path
import disnake import disnake
@@ -63,16 +64,13 @@ async def channel_send(message, *args, **kwargs):
def load_opus(): def load_opus():
for path in filter( path = ctypes.util._findLib_ld("opus")
lambda p: Path(p).exists(), try:
["/usr/lib64/libopus.so.0", "/usr/lib/libopus.so.0"], disnake.opus.load_opus(path)
): debug(f"successfully loaded opus from {path}")
try: return
disnake.opus.load_opus(path) except Exception as e:
info(f"successfully loaded opus from {path}") error(f"failed to load opus from {path}: {e}")
return
except Exception as e:
error(f"failed to load opus from {path}: {e}")
raise Exception("could not locate working opus library") raise Exception("could not locate working opus library")