admin/pull: if autopulling, don't autoload modules that aren't in

initial_cogs
This commit is contained in:
Ave 2020-05-25 14:10:10 +03:00
parent 3d4c0ecacf
commit 6cc6f540bf
No known key found for this signature in database
GPG key ID: 398DD7BD03276F6D

View file

@ -106,9 +106,13 @@ class Admin(Cog):
if auto: if auto:
cogs_to_reload = re.findall(r"cogs/([a-z_]*).py[ ]*\|", git_output) cogs_to_reload = re.findall(r"cogs/([a-z_]*).py[ ]*\|", git_output)
for cog in cogs_to_reload: for cog in cogs_to_reload:
cog_name = "cogs." + cog
if cog_name not in config.initial_cogs:
continue
try: try:
self.bot.unload_extension("cogs." + cog) self.bot.unload_extension(cog_name)
self.bot.load_extension("cogs." + cog) self.bot.load_extension(cog_name)
self.bot.log.info(f"Reloaded ext {cog}") self.bot.log.info(f"Reloaded ext {cog}")
await ctx.send(f":white_check_mark: `{cog}` successfully reloaded.") await ctx.send(f":white_check_mark: `{cog}` successfully reloaded.")
await self.cog_load_actions(cog) await self.cog_load_actions(cog)