Fixed remove_command error when trying to remove a non-existent command (#2889)

* Fixed remove_command error when trying to remove a non-existent command

* Added changelog entry
This commit is contained in:
DevilXD 2019-07-18 11:49:40 +02:00 committed by Michael H
parent 0ba9eaeccc
commit 7ba50c91a2
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1 @@
Fixed remove_command error when trying to remove a non-existent command

View File

@ -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()):