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)
for target in targets:
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 (
not idle_tracker["is_idle"]

View File

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