Skip to content

Commit

Permalink
Ensure that the help command doesn't show blank for no perms required
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 committed Jan 24, 2024
1 parent bf17d9f commit e760ceb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bot/libs/utils/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)


Expand Down

0 comments on commit e760ceb

Please sign in to comment.