Files

8 lines
370 B
Python
Raw Permalink Normal View History

2026-10-26 02:21:57 +01:00
from pathlib import Path
ROOT=Path(__file__).resolve().parent.parent
async def load_all(bot):
for d in ("cmds","events"):
for f in sorted((ROOT/d).glob("*.py")):
if f.name.startswith("_"):continue
try:await bot.load_extension(f"{d}.{f.stem}")
except Exception as e:bot.hook.put(f"module load failed: {d}.{f.stem}: {e!r}")