mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
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:
parent
0ba9eaeccc
commit
7ba50c91a2
1
changelog.d/2888.bugfix.rst
Normal file
1
changelog.d/2888.bugfix.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fixed remove_command error when trying to remove a non-existent command
|
||||||
@ -461,6 +461,8 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d
|
|||||||
|
|
||||||
def remove_command(self, name: str) -> None:
|
def remove_command(self, name: str) -> None:
|
||||||
command = super().remove_command(name)
|
command = super().remove_command(name)
|
||||||
|
if not command:
|
||||||
|
return
|
||||||
command.requires.reset()
|
command.requires.reset()
|
||||||
if isinstance(command, commands.Group):
|
if isinstance(command, commands.Group):
|
||||||
for subcommand in set(command.walk_commands()):
|
for subcommand in set(command.walk_commands()):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user