Bot.unload_extension: don't remove commands from no module
Fixes unload_extension in the case of a command added via eval
This commit is contained in:
parent
ef89d3aa22
commit
be7ea2678b
@ -734,6 +734,8 @@ class BotBase(GroupMixin):
|
|||||||
|
|
||||||
# first remove all the commands from the module
|
# first remove all the commands from the module
|
||||||
for cmd in self.all_commands.copy().values():
|
for cmd in self.all_commands.copy().values():
|
||||||
|
if cmd.module is None:
|
||||||
|
continue
|
||||||
if _is_submodule(lib_name, cmd.module):
|
if _is_submodule(lib_name, cmd.module):
|
||||||
if isinstance(cmd, GroupMixin):
|
if isinstance(cmd, GroupMixin):
|
||||||
cmd.recursively_remove_all_commands()
|
cmd.recursively_remove_all_commands()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user