diff --git a/changelog.d/2888.bugfix.rst b/changelog.d/2888.bugfix.rst new file mode 100644 index 000000000..19f76701d --- /dev/null +++ b/changelog.d/2888.bugfix.rst @@ -0,0 +1 @@ +Fixed remove_command error when trying to remove a non-existent command \ No newline at end of file diff --git a/redbot/core/bot.py b/redbot/core/bot.py index ceeb05ff0..9d047aed0 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -461,6 +461,8 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d def remove_command(self, name: str) -> None: command = super().remove_command(name) + if not command: + return command.requires.reset() if isinstance(command, commands.Group): for subcommand in set(command.walk_commands()):