diff options
| author | 2021-01-14 01:10:48 +0100 | |
|---|---|---|
| committer | 2021-01-14 05:01:14 +0100 | |
| commit | 1bdfdac30d27d67d95c49b5b66a0a4de919afa21 (patch) | |
| tree | 3e29c86f143a340fecfc7818c00d74a2d39b7afd | |
| parent | Set the user_requested attribute at the start of the coroutine (diff) | |
Ensure footer is actually max 100 chars
Shortening the renamed symbols string to 100 chars is not accurate
as the footer also contains a string before that, subtracting its length
fixes this.
| -rw-r--r-- | bot/exts/info/doc/_cog.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index 51283a67e..942d685af 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -262,10 +262,11 @@ class DocCog(commands.Cog): url=f"{symbol_info.url}#{symbol_info.symbol_id}", description=markdown ) - # Show all symbols with the same name that were renamed in the footer. + # Show all symbols with the same name that were renamed in the footer, + # with a max of 100 chars. if symbol in self.renamed_symbols: renamed_symbols = ', '.join(self.renamed_symbols[symbol]) - footer_text = f"Moved: {textwrap.shorten(renamed_symbols, 100, placeholder=' ...')}" + footer_text = f"Moved: {textwrap.shorten(renamed_symbols, 100-7, placeholder=' ...')}" else: footer_text = "" embed.set_footer(text=footer_text) |