Skip dunder files
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s

This commit is contained in:
Nexus 2024-04-29 01:43:05 +01:00
parent 40d16124c2
commit 77b2fe03c0
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -125,6 +125,8 @@ for module in CONFIG["jimmy"].get("modules", ["cogs/*.py"]):
log.debug("%r does not exist - trying as glob pattern", module)
for ext in glob.glob(module, recursive=True):
ext = ext.replace("/", ".")[:-3] # foo/bar.py -> foo.bar
if ext.split(".")[-1].startswith("__"):
log.info("Skipping loading %s - starts with double underscore." % ext)
try:
bot.load_extension(ext)
except (discord.ExtensionError, ModuleNotFoundError) as e: