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;
|
threadParentType === ChannelType.GuildForum || threadParentType === ChannelType.GuildMedia;
|
||||||
const forumParentSlug =
|
const forumParentSlug =
|
||||||
isForumParent && threadParentName ? normalizeDiscordSlug(threadParentName) : "";
|
isForumParent && threadParentName ? normalizeDiscordSlug(threadParentName) : "";
|
||||||
const isForumStarter =
|
const threadChannelId = threadChannel?.id;
|
||||||
threadChannel && isForumParent && forumParentSlug ? message.id === threadChannel.id : false;
|
const isForumStarter = Boolean(
|
||||||
|
threadChannelId && isForumParent && forumParentSlug && message.id === threadChannelId,
|
||||||
|
);
|
||||||
const forumContextLine = isForumStarter ? `[Forum parent: #${forumParentSlug}]` : null;
|
const forumContextLine = isForumStarter ? `[Forum parent: #${forumParentSlug}]` : null;
|
||||||
const groupChannel = isGuildMessage && displayChannelSlug ? `#${displayChannelSlug}` : undefined;
|
const groupChannel = isGuildMessage && displayChannelSlug ? `#${displayChannelSlug}` : undefined;
|
||||||
const groupSubject = isDirectMessage ? undefined : groupChannel;
|
const groupSubject = isDirectMessage ? undefined : groupChannel;
|
||||||
|
|||||||
Reference in New Issue
Block a user