mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 13:55:39 +00:00
more thread improvements
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user