diff options
| author | Rapptz <[email protected]> | 2021-03-28 18:35:59 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-03-28 18:35:59 -0400 |
| commit | 4aee7fed5df45eb2285b9677e5dd6eb3e2b140c1 (patch) | |
| tree | 699d6b27b36ed57b73dd34840a9bc275079e11cc | |
| parent | Add scopes to utils.oauth_url (diff) | |
| download | discord.py-4aee7fed5df45eb2285b9677e5dd6eb3e2b140c1.tar.xz discord.py-4aee7fed5df45eb2285b9677e5dd6eb3e2b140c1.zip | |
[commands] Only remove top level commands on cog load failure
| -rw-r--r-- | discord/ext/commands/cog.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index a7a76737..8cb3e4d2 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -408,7 +408,8 @@ class Cog(metaclass=CogMeta): except Exception as e: # undo our additions for to_undo in self.__cog_commands__[:index]: - bot.remove_command(to_undo.name) + if to_undo.parent is None: + bot.remove_command(to_undo.name) raise e # check if we're overriding the default |