Skip to content

Commit 3fbd94a

Browse files
committed
Don't repeat start of close message in every if branch
1 parent 6ee0b8a commit 3fbd94a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bot/exts/help_channels/_channel.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +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+
close_title = "Python help channel closed"
5051
if closing_reason == _stats.ClosingReason.CLEANUP:
51-
close_title = "Python help channel closed as OP left server"
52+
close_title += " as OP left server"
5253
elif closing_reason == _stats.ClosingReason.COMMAND:
53-
close_title = f"Python help channel closed by OP with {constants.Bot.prefix}close"
54+
close_title += f" by OP with {constants.Bot.prefix}close"
5455
elif closing_reason == _stats.ClosingReason.INACTIVE:
55-
close_title = "Python help channel closed for inactivity"
56+
close_title += " for inactivity"
5657
elif closing_reason == _stats.ClosingReason.NATIVE:
57-
close_title = "Python help channel closed by OP"
58-
else:
59-
close_title = "Python help channel closed"
58+
close_title += " by OP"
59+
6060

6161
embed.set_author(name=close_title, icon_url=CLOSED_POST_ICON_URL)
6262
message = ""

0 commit comments

Comments
 (0)