diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 85b8d1341..34ab30e2c 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -768,6 +768,9 @@ class BotBase(GroupMixin): del lib del self.extensions[name] del sys.modules[name] + for module in list(sys.modules.keys()): + if _is_submodule(lib_name, module): + del sys.modules[module] # command processing