diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts
index be52450a..e9b91a3d 100644
--- a/src/gateway/opcodes/Identify.ts
+++ b/src/gateway/opcodes/Identify.ts
@@ -450,7 +450,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
...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 4bfe3b2f..e5d99074 100644
--- a/src/schemas/api/channels/Channel.ts
+++ b/src/schemas/api/channels/Channel.ts
@@ -36,7 +36,7 @@ export enum ChannelPermissionOverwriteType {
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 226b9ea1..6cfe340c 100644
--- a/src/schemas/uncategorised/ChannelModifySchema.ts
+++ b/src/schemas/uncategorised/ChannelModifySchema.ts
@@ -45,4 +45,7 @@ export interface ChannelModifySchema {
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 72992224..ed78d7dd 100644
--- a/src/schemas/uncategorised/MessageThreadCreationSchema.ts
+++ b/src/schemas/uncategorised/MessageThreadCreationSchema.ts
@@ -16,10 +16,12 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+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 3ea9f1b8..a9bbd331 100644
--- a/src/util/dtos/ReadyGuildDTO.ts
+++ b/src/util/dtos/ReadyGuildDTO.ts
@@ -34,9 +34,9 @@ export interface ReadyPrivateChannel {
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 @@ export class ReadyGuildDTO implements IReadyGuildDTO {
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;
|