diff options
author | 2023-01-23 11:45:45 +0000 | |
---|---|---|
committer | 2023-01-23 11:45:45 +0000 | |
commit | 27940591ea49b421abe44b2d08911afc074903f8 (patch) | |
tree | b43f2bcdd07eff9a04bd75216d92074037d64454 | |
parent | Merge pull request #2341 from shtlrs/2332-permanent-role-view (diff) |
Add icons to help channel bot embeds
-rw-r--r-- | bot/exts/help_channels/_channel.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index fad2a32a9..695c71b95 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -14,8 +14,9 @@ from bot.log import get_logger log = get_logger(__name__) ASKING_GUIDE_URL = "https://pythondiscord.com/pages/asking-good-questions/" - +BRANDING_REPO_RAW_URL = "https://raw.githubusercontent.com/python-discord/branding" POST_TITLE = "Python help channel" + NEW_POST_MSG = f""" **Remember to:** • **Ask** your Python question, not if you can ask or if there's an expert who can help. @@ -24,7 +25,8 @@ NEW_POST_MSG = f""" For more tips, check out our guide on [asking good questions]({ASKING_GUIDE_URL}). """ -POST_FOOTER = f"Closes after a period of inactivity, or when you send {constants.Bot.prefix}close." +NEW_POST_FOOTER = f"Closes after a period of inactivity, or when you send {constants.Bot.prefix}close." +NEW_POST_ICON_URL = f"{BRANDING_REPO_RAW_URL}/main/icons/checkmark/green-checkmark-dist.png" DORMANT_MSG = f""" This help channel has been marked as **dormant** and locked. \ @@ -34,6 +36,7 @@ If your question wasn't answered yet, you can create a new post in <#{constants. Consider rephrasing the question to maximize your chance of getting a good answer. \ If you're not sure how, have a look through our guide for **[asking a good question]({ASKING_GUIDE_URL})**. """ +CLOSED_POST_ICON_URL = f"{BRANDING_REPO_RAW_URL}/main/icons/zzz/zzz-dist.png" def is_help_forum_post(channel: discord.abc.GuildChannel) -> bool: @@ -45,6 +48,7 @@ def is_help_forum_post(channel: discord.abc.GuildChannel) -> bool: async def _close_help_post(closed_post: discord.Thread, closing_reason: _stats.ClosingReason) -> None: """Close the help post and record stats.""" embed = discord.Embed(description=DORMANT_MSG) + embed.set_author(name=POST_TITLE, icon_url=CLOSED_POST_ICON_URL) await closed_post.send(embed=embed) await closed_post.edit(archived=True, locked=True, reason="Locked a dormant help post") @@ -71,8 +75,8 @@ async def send_opened_post_message(post: discord.Thread) -> None: color=constants.Colours.bright_green, description=NEW_POST_MSG, ) - embed.set_author(name=POST_TITLE) - embed.set_footer(text=POST_FOOTER) + embed.set_author(name=POST_TITLE, icon_url=NEW_POST_ICON_URL) + embed.set_footer(text=NEW_POST_FOOTER) await post.send(embed=embed) |