diff options
author | 2021-03-06 03:47:21 +0100 | |
---|---|---|
committer | 2021-03-06 03:47:21 +0100 | |
commit | 7d596f5d8fb454f00288b0a6fbd60789c5dd17be (patch) | |
tree | 29f7c480be664eb0fd8e8b825a08abb7f599b2ad | |
parent | Abstract logic from create_symbol_embed into additional methods (diff) |
Create the footer text before an inventory refresh can occur
-rw-r--r-- | bot/exts/info/doc/_cog.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index 64e204fad..c01e0f36a 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -282,11 +282,6 @@ class DocCog(commands.Cog): self.bot.stats.incr(f"doc_fetches.{doc_item.package}") - embed = discord.Embed( - title=discord.utils.escape_markdown(symbol_name), - url=f"{doc_item.url}#{doc_item.symbol_id}", - description=await self.get_symbol_markdown(doc_item) - ) # Show all symbols with the same name that were renamed in the footer, # with a max of 100 chars. if symbol_name in self.renamed_symbols: @@ -294,6 +289,12 @@ class DocCog(commands.Cog): footer_text = textwrap.shorten("Moved: " + renamed_symbols, 100, placeholder=' ...') else: footer_text = "" + + embed = discord.Embed( + title=discord.utils.escape_markdown(symbol_name), + url=f"{doc_item.url}#{doc_item.symbol_id}", + description=await self.get_symbol_markdown(doc_item) + ) embed.set_footer(text=footer_text) return embed |