From 6cc6f540bf37f989e6d46db1b678f5efb6b87d61 Mon Sep 17 00:00:00 2001 From: Ave Date: Mon, 25 May 2020 14:10:10 +0300 Subject: [PATCH] admin/pull: if autopulling, don't autoload modules that aren't in initial_cogs --- cogs/admin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cogs/admin.py b/cogs/admin.py index 554b462..b3b4326 100644 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -106,9 +106,13 @@ class Admin(Cog): if auto: cogs_to_reload = re.findall(r"cogs/([a-z_]*).py[ ]*\|", git_output) for cog in cogs_to_reload: + cog_name = "cogs." + cog + if cog_name not in config.initial_cogs: + continue + try: - self.bot.unload_extension("cogs." + cog) - self.bot.load_extension("cogs." + cog) + self.bot.unload_extension(cog_name) + self.bot.load_extension(cog_name) self.bot.log.info(f"Reloaded ext {cog}") await ctx.send(f":white_check_mark: `{cog}` successfully reloaded.") await self.cog_load_actions(cog)