fix: guard discord thread channel
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user