aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Steele Farnsworth <[email protected]>2025-01-04 16:04:56 -0500
committerGravatar Steele Farnsworth <[email protected]>2025-01-04 16:04:56 -0500
commit3df806ef67f2a2f8c021145186571cbca46b4ac1 (patch)
treef2a2a7cd6fdb1bb1f5922aad7014f50a3c004414
parentBump pydantic-settings from 2.6.1 to 2.7.1 (#3222) (diff)
Re-fetch help threads before closing.
This ensures that the thread title is up-to-date. Previously, even if someone changed the title of the thread, the bot might prepend the lock emoji to an older version of the title.
-rw-r--r--bot/exts/help_channels/_channel.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py
index cf3cdbaf6..9cf95e254 100644
--- a/bot/exts/help_channels/_channel.py
+++ b/bot/exts/help_channels/_channel.py
@@ -3,6 +3,7 @@ from datetime import timedelta
import arrow
import discord
+import pydis_core
from pydis_core.utils import scheduling
from pydis_core.utils.channel import get_or_fetch_channel
@@ -44,6 +45,9 @@ def is_help_forum_post(channel: discord.abc.GuildChannel) -> bool:
async def _close_help_post(closed_post: discord.Thread, closing_reason: _stats.ClosingReason) -> None:
"""Close the help post and record stats."""
+ # Get Thread with updated metadata (such as the title)
+ closed_post = await pydis_core.utils.channel.get_or_fetch_channel(bot.instance, closed_post.id)
+
embed = discord.Embed(description=CLOSED_POST_MSG)
embed.set_author(name=f"{POST_TITLE} closed", icon_url=CLOSED_POST_ICON_URL)
message = ""