diff options
| author | 2020-09-28 15:36:02 +0300 | |
|---|---|---|
| committer | 2020-09-28 15:36:02 +0300 | |
| commit | fe4eaeb182553f81afc7451c4aeaf1d865a9b18c (patch) | |
| tree | 039834671b02dd2f6039148f6151a743891a2126 | |
| parent | Help: Add handling of disabled commands to avoid DisabledCommand error (diff) | |
Help: Show different message for case when command is disabled
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/info/help.py | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/bot/exts/info/help.py b/bot/exts/info/help.py index 5d83f8f86..803fcb2bb 100644 --- a/bot/exts/info/help.py +++ b/bot/exts/info/help.py @@ -173,8 +173,11 @@ class CustomHelpCommand(HelpCommand):          if aliases:              command_details += f"**Can also use:** {aliases}\n\n" -        # check if the user is allowed to run this command -        if not command.enabled or not await command.can_run(self.context): +        # when command is disabled, show message about it +        # otherwise check if the user is allowed to run this command +        if not command.enabled: +            command_details += "***This command is disabled.***\n\n" +        elif not await command.can_run(self.context):              command_details += "***You cannot run this command.***\n\n"          command_details += f"*{command.help or 'No details provided.'}*\n" | 
