fix: guard discord thread channel

This commit is contained in:
Peter Steinberger
2026-01-25 04:11:16 +00:00
parent 458e731f8b
commit 50bb418fe7

View File

@@ -135,8 +135,10 @@ export async function processDiscordMessage(ctx: DiscordMessagePreflightContext)
threadParentType === ChannelType.GuildForum || threadParentType === ChannelType.GuildMedia;
const forumParentSlug =
isForumParent && threadParentName ? normalizeDiscordSlug(threadParentName) : "";
const isForumStarter =
threadChannel && isForumParent && forumParentSlug ? message.id === threadChannel.id : false;
const threadChannelId = threadChannel?.id;
const isForumStarter = Boolean(
threadChannelId && isForumParent && forumParentSlug && message.id === threadChannelId,
);
const forumContextLine = isForumStarter ? `[Forum parent: #${forumParentSlug}]` : null;
const groupChannel = isGuildMessage && displayChannelSlug ? `#${displayChannelSlug}` : undefined;
const groupSubject = isDirectMessage ? undefined : groupChannel;