diff options
| author | Ben Mintz <[email protected]> | 2018-08-12 01:19:58 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-08-22 21:56:41 -0400 |
| commit | be7ea2678be492dfad644168a53a197a47b4fc59 (patch) | |
| tree | d699f5bb7b573e4c89d0a808462578d876d3f952 | |
| parent | Add support for converters working with PEP-563 (diff) | |
| download | discord.py-be7ea2678be492dfad644168a53a197a47b4fc59.tar.xz discord.py-be7ea2678be492dfad644168a53a197a47b4fc59.zip | |
Bot.unload_extension: don't remove commands from no module
Fixes unload_extension in the case of a command added via eval
| -rw-r--r-- | discord/ext/commands/bot.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 2dd22772..c652c637 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -734,6 +734,8 @@ class BotBase(GroupMixin): # first remove all the commands from the module for cmd in self.all_commands.copy().values(): + if cmd.module is None: + continue if _is_submodule(lib_name, cmd.module): if isinstance(cmd, GroupMixin): cmd.recursively_remove_all_commands() |