diff options
-rw-r--r-- | bot/exts/help_channels/_channel.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index 670a10446..63a83c8fa 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -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=10, 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() |