From 06ba4251595104ad070cc44e4290b50661c3d294 Mon Sep 17 00:00:00 2001 From: Samuel <50765275+npc203@users.noreply.github.com> Date: Wed, 16 Dec 2020 23:01:26 +0530 Subject: [PATCH] bot.remove_command returns a dpy command object instead of None (#4636) * remove_command returns a dpy command object * removed typehint at remove_command * typing Co-authored-by: npc203 --- redbot/core/bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/redbot/core/bot.py b/redbot/core/bot.py index a0c41034e..37537868e 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -1374,14 +1374,15 @@ class RedBase( if permissions_not_loaded: subcommand.requires.ready_event.set() - def remove_command(self, name: str) -> None: + def remove_command(self, name: str) -> Optional[commands.Command]: command = super().remove_command(name) - if not command: - return + if command is None: + return None command.requires.reset() if isinstance(command, commands.Group): for subcommand in command.walk_commands(): subcommand.requires.reset() + return command def clear_permission_rules(self, guild_id: Optional[int], **kwargs) -> None: """Clear all permission overrides in a scope.