diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index be52450..e9b91a3 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -450,7 +450,7 @@ ...member.guild.toJSON(), joined_at: member.joined_at, - threads: [], + threads: member.guild.channels.filter((x) => x.isThread()), }; }); const generateGuildsListTime = taskSw.getElapsedAndReset(); diff --git a/src/schemas/api/channels/Channel.ts b/src/schemas/api/channels/Channel.ts index 4bfe3b2..e5d9907 100644 --- a/src/schemas/api/channels/Channel.ts +++ b/src/schemas/api/channels/Channel.ts @@ -36,7 +36,7 @@ member = 1, group = 2, } -export interface threadMetadata { +export interface ThreadMetadata { archived: boolean; auto_archive_duration: number; archive_timestamp: string; diff --git a/src/schemas/uncategorised/ChannelModifySchema.ts b/src/schemas/uncategorised/ChannelModifySchema.ts index 226b9ea..6cfe340 100644 --- a/src/schemas/uncategorised/ChannelModifySchema.ts +++ b/src/schemas/uncategorised/ChannelModifySchema.ts @@ -45,4 +45,7 @@ flags?: number; default_thread_rate_limit_per_user?: number; video_quality_mode?: number; + auto_archive_duration?: number; + archived?: boolean; + locked?: boolean; } diff --git a/src/schemas/uncategorised/MessageThreadCreationSchema.ts b/src/schemas/uncategorised/MessageThreadCreationSchema.ts index 7299222..ed78d7d 100644 --- a/src/schemas/uncategorised/MessageThreadCreationSchema.ts +++ b/src/schemas/uncategorised/MessageThreadCreationSchema.ts @@ -16,10 +16,12 @@ along with this program. If not, see . */ +import { ChannelType } from "../api"; + export interface MessageThreadCreationSchema { auto_archive_duration?: number; rate_limit_per_user?: number; name: string; - type?: number; + type?: ChannelType.GUILD_NEWS_THREAD | ChannelType.GUILD_PRIVATE_THREAD | ChannelType.GUILD_PUBLIC_THREAD; location?: string; //0 clue what this means lol } diff --git a/src/util/dtos/ReadyGuildDTO.ts b/src/util/dtos/ReadyGuildDTO.ts index 3ea9f1b..a9bbd33 100644 --- a/src/util/dtos/ReadyGuildDTO.ts +++ b/src/util/dtos/ReadyGuildDTO.ts @@ -34,9 +34,9 @@ type: ChannelType.DM | ChannelType.GROUP_DM; } -export type GuildOrUnavailable = { id: string; unavailable: boolean } | (Guild & { joined_at?: Date; unavailable: undefined }); +export type GuildOrUnavailable = { id: string; unavailable: boolean } | (Guild & { joined_at?: Date; unavailable: undefined; threads: Channel[] }); -const guildIsAvailable = (guild: GuildOrUnavailable): guild is Guild & { joined_at: Date; unavailable: false } => { +const guildIsAvailable = (guild: GuildOrUnavailable): guild is Guild & { joined_at: Date; unavailable: false; threads: Channel[] } => { return guild.unavailable != true; }; @@ -215,7 +215,7 @@ this.roles = guild.roles.map((x) => x.toJSON()); this.stage_instances = []; this.stickers = guild.stickers; - this.threads = []; + this.threads = guild.threads; this.version = "1"; // ?????? this.guild_hashes = {}; this.joined_at = guild.joined_at;