Skip dunder files
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 7s
This commit is contained in:
parent
40d16124c2
commit
77b2fe03c0
1 changed files with 2 additions and 0 deletions
|
@ -125,6 +125,8 @@ for module in CONFIG["jimmy"].get("modules", ["cogs/*.py"]):
|
||||||
log.debug("%r does not exist - trying as glob pattern", module)
|
log.debug("%r does not exist - trying as glob pattern", module)
|
||||||
for ext in glob.glob(module, recursive=True):
|
for ext in glob.glob(module, recursive=True):
|
||||||
ext = ext.replace("/", ".")[:-3] # foo/bar.py -> foo.bar
|
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:
|
try:
|
||||||
bot.load_extension(ext)
|
bot.load_extension(ext)
|
||||||
except (discord.ExtensionError, ModuleNotFoundError) as e:
|
except (discord.ExtensionError, ModuleNotFoundError) as e:
|
||||||
|
|
Loading…
Reference in a new issue