diff options
| author | 2021-10-17 10:43:17 +0100 | |
|---|---|---|
| committer | 2021-10-17 10:43:17 +0100 | |
| commit | 707bceec0c7f0c98aea640700c769b6a461dd1af (patch) | |
| tree | a36330f24e2860a204527fdd30025ab9effaac96 | |
| parent | Merge pull request #1871 from python-discord/modlog-ingore-channels-mods-can'... (diff) | |
| parent | Merge branch 'main' into fix-help-description-spacing (diff) | |
Merge pull request #1876 from python-discord/fix-help-description-spacing
Formats Help Command Output
| -rw-r--r-- | bot/exts/info/help.py | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/exts/info/help.py b/bot/exts/info/help.py index f413caded..743dfdd3f 100644 --- a/bot/exts/info/help.py +++ b/bot/exts/info/help.py @@ -1,4 +1,5 @@  import itertools +import re  from collections import namedtuple  from contextlib import suppress  from typing import List, Union @@ -179,7 +180,10 @@ class CustomHelpCommand(HelpCommand):          except CommandError:              command_details += NOT_ALLOWED_TO_RUN_MESSAGE -        command_details += f"*{command.help or 'No details provided.'}*\n" +        # Remove line breaks from docstrings, if not used to separate paragraphs. +        # Allow overriding this behaviour via putting \u2003 at the start of a line. +        formatted_doc = re.sub("(?<!\n)\n(?![\n\u2003])", " ", command.help) +        command_details += f"*{formatted_doc or 'No details provided.'}*\n"          embed.description = command_details          return embed  |