[commands] Correct command removing during cog injecting

This commit is contained in:
Dan Hess 2020-09-09 18:48:00 -05:00 committed by GitHub
parent f8a7d3fc54
commit 7acec502a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -385,7 +385,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]:
bot.remove_command(to_undo) bot.remove_command(to_undo.name)
raise e raise e
# check if we're overriding the default # check if we're overriding the default