Skip to content

Commit 9ae4922

Browse files
committed
Change closing embed title based on close reason
1 parent ea41edc commit 9ae4922

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bot/exts/help_channels/_channel.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ async def _close_help_post(closed_post: discord.Thread, closing_reason: _stats.C
4747
closed_post = await get_or_fetch_channel(bot.instance, closed_post.id)
4848

4949
embed = discord.Embed(description=CLOSED_POST_MSG)
50-
embed.set_author(name=f"{POST_TITLE} closed", icon_url=CLOSED_POST_ICON_URL)
50+
if closing_reason == _stats.ClosingReason.CLEANUP:
51+
close_title = "Python help channel closed as OP left server"
52+
elif closing_reason == _stats.ClosingReason.COMMAND:
53+
close_title = f"Python help channel closed by OP with {constants.Bot.prefix}close"
54+
elif closing_reason == _stats.ClosingReason.INACTIVE:
55+
close_title = "Python help channel closed for inactivity"
56+
else:
57+
close_title = "Python help channel closed"
58+
59+
embed.set_author(name=close_title, icon_url=CLOSED_POST_ICON_URL)
5160
message = ""
5261

5362
# Include a ping in the close message if no one else engages, to encourage them

0 commit comments

Comments
 (0)