Skip to content

Commit fbb45e3

Browse files
committed
plugin reset, remove unloaded plugins from self.loaded_plugins
1 parent 6b00612 commit fbb45e3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cogs/plugins.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,13 @@ async def plugins_reset(self, ctx):
538538
self.bot.unload_extension(ext)
539539
except Exception:
540540
logger.error("Failed to unload plugin: %s.", ext)
541+
else:
542+
if not self.loaded_plugins:
543+
continue
544+
plugin = next((p for p in self.loaded_plugins if p.ext_string == ext), None)
545+
if plugin:
546+
self.loaded_plugins.remove(plugin)
547+
541548
self.bot.config["plugins"].clear()
542549
await self.bot.config.update()
543550

0 commit comments

Comments
 (0)