summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-02-03 21:05:32 -0600
committerMathMan05 <mathmanrm@gmail.com>2026-02-03 21:05:32 -0600
commit323ed548ef3c397fa56ddfd6887aaf942557599c (patch)
tree2265c0c9858068479b8f669bfd2670fc7025bfd9
parentstupid migration (diff)
downloadserver-ts-323ed548ef3c397fa56ddfd6887aaf942557599c.tar.xz
more thread improvements
-rw-r--r--src/api/routes/channels/#channel_id/threads.ts2
-rw-r--r--src/schemas/uncategorised/ThreadCreationSchema.ts2
-rw-r--r--src/util/entities/Channel.ts3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/api/routes/channels/#channel_id/threads.ts b/src/api/routes/channels/#channel_id/threads.ts

index 79392fe6..9c1a1d0b 100644 --- a/src/api/routes/channels/#channel_id/threads.ts +++ b/src/api/routes/channels/#channel_id/threads.ts
@@ -68,7 +68,7 @@ router.post( 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 ca1f25e2..1ad85ce7 100644 --- a/src/schemas/uncategorised/ThreadCreationSchema.ts +++ b/src/schemas/uncategorised/ThreadCreationSchema.ts
@@ -24,7 +24,7 @@ export interface ThreadCreationSchema { 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 d57d8361..751fa3ad 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts
@@ -281,6 +281,9 @@ export class Channel extends BaseClass { return ret; } + threadOnly() { + return this.type === ChannelType.GUILD_FORUM || this.type === ChannelType.GUILD_MEDIA; + } static async createThreadChannel( channel: Partial<Channel>,