mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
change: make thread#guildId a getter (#1063)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { cache } from "../../cache.ts";
|
||||||
import { Channel } from "../../types/channels/channel.ts";
|
import { Channel } from "../../types/channels/channel.ts";
|
||||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||||
import { ThreadMemberModified } from "../../types/channels/threads/thread_member.ts";
|
import { ThreadMemberModified } from "../../types/channels/threads/thread_member.ts";
|
||||||
@@ -25,6 +26,9 @@ const baseThread: Partial<DiscordenoThread> = {
|
|||||||
get isPublic() {
|
get isPublic() {
|
||||||
return !this.isPrivate;
|
return !this.isPrivate;
|
||||||
},
|
},
|
||||||
|
get guildId() {
|
||||||
|
return cache.channels.get(this.parentId!)!.guildId;
|
||||||
|
},
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
id: this.id?.toString(),
|
id: this.id?.toString(),
|
||||||
@@ -59,7 +63,6 @@ export function channelToThread(channel: Channel) {
|
|||||||
bitfield: createNewProp(bitfield),
|
bitfield: createNewProp(bitfield),
|
||||||
ownerId: createNewProp(snowflakeToBigint(channel.ownerId!)),
|
ownerId: createNewProp(snowflakeToBigint(channel.ownerId!)),
|
||||||
botIsMember: createNewProp(Boolean(channel.member)),
|
botIsMember: createNewProp(Boolean(channel.member)),
|
||||||
guildId: createNewProp(snowflakeToBigint(channel.guildId!)),
|
|
||||||
members: createNewProp(new Collection<bigint, Omit<ThreadMemberModified, "id">>()),
|
members: createNewProp(new Collection<bigint, Omit<ThreadMemberModified, "id">>()),
|
||||||
}) as DiscordenoThread;
|
}) as DiscordenoThread;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user