From d98d6c6669bd4ed80ed85c13bb1dec0336122d4d Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Mon, 29 Apr 2024 01:42:02 +0100 Subject: [PATCH] Fix cog auto-load --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 0b22116..bfc8c54 100644 --- a/src/main.py +++ b/src/main.py @@ -121,7 +121,7 @@ bot = Client( for module in CONFIG["jimmy"].get("modules", ["cogs/*.py"]): try: bot.load_extension(module) - except discord.ExtensionNotFound: + except (discord.ExtensionNotFound, ModuleNotFoundError): 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