Compare commits
2 Commits
69f5af19ae
...
914a5df812
| Author | SHA1 | Date | |
|---|---|---|---|
|
914a5df812
|
|||
|
8ed9d05a67
|
1
tasks.py
1
tasks.py
@@ -19,6 +19,7 @@ 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]
|
||||||
|
if len(targets):
|
||||||
debug(f"cleanup thread removed {len(targets)} empty players")
|
debug(f"cleanup thread removed {len(targets)} empty players")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -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,13 +64,10 @@ 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(),
|
|
||||||
["/usr/lib64/libopus.so.0", "/usr/lib/libopus.so.0"],
|
|
||||||
):
|
|
||||||
try:
|
try:
|
||||||
disnake.opus.load_opus(path)
|
disnake.opus.load_opus(path)
|
||||||
info(f"successfully loaded opus from {path}")
|
debug(f"successfully loaded opus from {path}")
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error(f"failed to load opus from {path}: {e}")
|
error(f"failed to load opus from {path}: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user