From e760ceb328b8647c1b8074cbd6f90ce95fb5d27e Mon Sep 17 00:00:00 2001 From: No767 <73260931+No767@users.noreply.github.com> Date: Tue, 23 Jan 2024 23:02:52 -0800 Subject: [PATCH] Ensure that the help command doesn't show blank for no perms required --- bot/libs/utils/help.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/libs/utils/help.py b/bot/libs/utils/help.py index 454576f..2786745 100644 --- a/bot/libs/utils/help.py +++ b/bot/libs/utils/help.py @@ -13,7 +13,9 @@ # Light Orange (255, 199, 184) - Used for command pages -def process_perms_name(command: Union[commands.Group, commands.Command]): +def process_perms_name( + command: Union[commands.Group, commands.Command] +) -> Optional[str]: merge_list = [] if ( all(isinstance(parent, commands.Group) for parent in command.parents) @@ -28,6 +30,8 @@ def process_perms_name(command: Union[commands.Group, commands.Command]): merge_list.extend([*command.extras["permissions"]]) perms_set = sorted(set(merge_list)) + if len(perms_set) == 0: + return None return ", ".join(name.replace("_", " ").title() for name in perms_set)