Skip to content

Commit 0e7cbe9

Browse files
tzy-17claude
andcommitted
fix(discord): cast channel type for default_auto_archive_duration access
The APIChannel union type does not expose default_auto_archive_duration on all members. Since we already verified the channel is forum/GuildMedia before reading this field, use a safe structural cast to access it. Co-Authored-By: Claude Opus 4.7 <[email protected]>
1 parent 108ada7 commit 0e7cbe9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

extensions/discord/src/send.messages.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ export async function createThreadDiscord(
175175
// Discord applies its API default (4320 / 3 days), ignoring the forum's
176176
// configured default and causing threads to linger longer than intended.
177177
if (!payload.autoArchiveMinutes && isForumLike) {
178-
const forumDefault = channel?.default_auto_archive_duration;
178+
const forumDefault = (channel as { default_auto_archive_duration?: number } | undefined)
179+
?.default_auto_archive_duration;
179180
if (typeof forumDefault === "number") {
180181
body.auto_archive_duration = forumDefault;
181182
}

0 commit comments

Comments
 (0)