mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 20:28:55 -05:00
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 <npc203@users.noreply.github.com>
This commit is contained in:
parent
6038ef5550
commit
06ba425159
@ -1374,14 +1374,15 @@ class RedBase(
|
|||||||
if permissions_not_loaded:
|
if permissions_not_loaded:
|
||||||
subcommand.requires.ready_event.set()
|
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)
|
command = super().remove_command(name)
|
||||||
if not command:
|
if command is None:
|
||||||
return
|
return None
|
||||||
command.requires.reset()
|
command.requires.reset()
|
||||||
if isinstance(command, commands.Group):
|
if isinstance(command, commands.Group):
|
||||||
for subcommand in command.walk_commands():
|
for subcommand in command.walk_commands():
|
||||||
subcommand.requires.reset()
|
subcommand.requires.reset()
|
||||||
|
return command
|
||||||
|
|
||||||
def clear_permission_rules(self, guild_id: Optional[int], **kwargs) -> None:
|
def clear_permission_rules(self, guild_id: Optional[int], **kwargs) -> None:
|
||||||
"""Clear all permission overrides in a scope.
|
"""Clear all permission overrides in a scope.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user