From 1bdfdac30d27d67d95c49b5b66a0a4de919afa21 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Thu, 14 Jan 2021 01:10:48 +0100 Subject: 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. --- bot/exts/info/doc/_cog.py | 5 +++-- 1 file 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) -- cgit v1.2.3