[commands] Only remove top level commands on cog load failure
This commit is contained in:
parent
a4d29e8cfd
commit
4aee7fed5d
@ -408,6 +408,7 @@ class Cog(metaclass=CogMeta):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
# undo our additions
|
# undo our additions
|
||||||
for to_undo in self.__cog_commands__[:index]:
|
for to_undo in self.__cog_commands__[:index]:
|
||||||
|
if to_undo.parent is None:
|
||||||
bot.remove_command(to_undo.name)
|
bot.remove_command(to_undo.name)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user