aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/help_channels/_channel.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py
index 670a10446..b1a319145 100644
--- a/bot/exts/help_channels/_channel.py
+++ b/bot/exts/help_channels/_channel.py
@@ -17,13 +17,13 @@ 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"""
+NEW_POST_MSG = """
**Remember to:**
• **Ask** your Python question, not if you can ask or if there's an expert who can help.
• **Show** a code sample as text (rather than a screenshot) and the error message, if you've got one.
• **Explain** what you expect to happen and what actually happens.
-For more tips, check out our guide on [asking good questions]({ASKING_GUIDE_URL}).
+:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
"""
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"
@@ -46,8 +46,19 @@ async def _close_help_post(closed_post: discord.Thread, closing_reason: _stats.C
"""Close the help post and record stats."""
embed = discord.Embed(description=CLOSED_POST_MSG)
embed.set_author(name=f"{POST_TITLE} closed", icon_url=CLOSED_POST_ICON_URL)
-
- await closed_post.send(embed=embed)
+ message = ''
+
+ # Include a ping in the close message if no one else engages, to encourage them
+ # to read the guide for asking better questions
+ if closing_reason == _stats.ClosingReason.INACTIVE and closed_post.owner is not None:
+ participant_ids = {
+ message.author.id async for message in closed_post.history(limit=100, oldest_first=False)
+ if not message.author.bot
+ }
+ if participant_ids == {closed_post.owner_id}:
+ message = closed_post.owner.mention
+
+ await closed_post.send(message, embed=embed)
await closed_post.edit(archived=True, locked=True, reason="Locked a closed help post")
_stats.report_post_count()
@@ -75,7 +86,7 @@ async def send_opened_post_message(post: discord.Thread) -> None:
)
embed.set_author(name=f"{POST_TITLE} opened", icon_url=NEW_POST_ICON_URL)
embed.set_footer(text=NEW_POST_FOOTER)
- await post.send(embed=embed)
+ await post.send(embed=embed, content=post.owner.mention)
async def send_opened_post_dm(post: discord.Thread) -> None: