diff --git "a/src/api/routes/channels/\043channel_id/threads.ts" "b/src/api/routes/channels/\043channel_id/threads.ts" index 79392fe..9c1a1d0 100644 --- "a/src/api/routes/channels/\043channel_id/threads.ts" +++ "b/src/api/routes/channels/\043channel_id/threads.ts" @@ -68,7 +68,7 @@ name: body.name, guild_id: channel.guild_id, rate_limit_per_user: body.rate_limit_per_user, - type: body.type, + type: body.type || (channel.threadOnly() ? ChannelType.GUILD_PUBLIC_THREAD : ChannelType.GUILD_PRIVATE_THREAD), recipients: [], thread_metadata: { archived: false, diff --git a/src/schemas/uncategorised/ThreadCreationSchema.ts b/src/schemas/uncategorised/ThreadCreationSchema.ts index ca1f25e..1ad85ce 100644 --- a/src/schemas/uncategorised/ThreadCreationSchema.ts +++ b/src/schemas/uncategorised/ThreadCreationSchema.ts @@ -24,7 +24,7 @@ auto_archive_duration?: number; rate_limit_per_user?: number; name: string; - type: ChannelType.GUILD_PUBLIC_THREAD | ChannelType.GUILD_PRIVATE_THREAD; + type?: ChannelType.GUILD_PUBLIC_THREAD | ChannelType.GUILD_PRIVATE_THREAD; invitable?: boolean; applied_tags?: string[]; location?: string; //Ignore it diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts index d57d836..751fa3a 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts @@ -281,6 +281,9 @@ return ret; } + threadOnly() { + return this.type === ChannelType.GUILD_FORUM || this.type === ChannelType.GUILD_MEDIA; + } static async createThreadChannel( channel: Partial,