diff --git a/src/util/transformers/channel_to_thread.ts b/src/util/transformers/channel_to_thread.ts index c9822fbad..4c39bed17 100644 --- a/src/util/transformers/channel_to_thread.ts +++ b/src/util/transformers/channel_to_thread.ts @@ -1,3 +1,4 @@ +import { cache } from "../../cache.ts"; import { Channel } from "../../types/channels/channel.ts"; import { DiscordChannelTypes } from "../../types/channels/channel_types.ts"; import { ThreadMemberModified } from "../../types/channels/threads/thread_member.ts"; @@ -25,6 +26,9 @@ const baseThread: Partial = { get isPublic() { return !this.isPrivate; }, + get guildId() { + return cache.channels.get(this.parentId!)!.guildId; + }, toJSON() { return { id: this.id?.toString(), @@ -59,7 +63,6 @@ export function channelToThread(channel: Channel) { bitfield: createNewProp(bitfield), ownerId: createNewProp(snowflakeToBigint(channel.ownerId!)), botIsMember: createNewProp(Boolean(channel.member)), - guildId: createNewProp(snowflakeToBigint(channel.guildId!)), members: createNewProp(new Collection>()), }) as DiscordenoThread; }