more thread improvements

This commit is contained in:
MathMan05
2026-02-03 21:05:32 -06:00
parent ce9eac5bf8
commit 323ed548ef
3 changed files with 5 additions and 2 deletions

View File

@@ -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,

View File

@@ -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

View File

@@ -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>,