From 3fbd94acd81eda706f82d9682bd3ddeef932d7f6 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 18 Jan 2025 17:22:29 +0000 Subject: Don't repeat start of close message in every if branch --- bot/exts/help_channels/_channel.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index 1d43b6177..1b847bdb8 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -47,16 +47,16 @@ async def _close_help_post(closed_post: discord.Thread, closing_reason: _stats.C closed_post = await get_or_fetch_channel(bot.instance, closed_post.id) embed = discord.Embed(description=CLOSED_POST_MSG) + close_title = "Python help channel closed" if closing_reason == _stats.ClosingReason.CLEANUP: - close_title = "Python help channel closed as OP left server" + close_title += " as OP left server" elif closing_reason == _stats.ClosingReason.COMMAND: - close_title = f"Python help channel closed by OP with {constants.Bot.prefix}close" + close_title += f" by OP with {constants.Bot.prefix}close" elif closing_reason == _stats.ClosingReason.INACTIVE: - close_title = "Python help channel closed for inactivity" + close_title += " for inactivity" elif closing_reason == _stats.ClosingReason.NATIVE: - close_title = "Python help channel closed by OP" - else: - close_title = "Python help channel closed" + close_title += " by OP" + embed.set_author(name=close_title, icon_url=CLOSED_POST_ICON_URL) message = "" -- cgit v1.2.3