diff options
-rw-r--r-- | util/src/entities/Member.ts | 21 | ||||
-rw-r--r-- | util/src/interfaces/Event.ts | 11 |
2 files changed, 28 insertions, 4 deletions
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts index ae60f4e2..db4e827b 100644 --- a/util/src/entities/Member.ts +++ b/util/src/entities/Member.ts @@ -208,7 +208,7 @@ export class Member extends BaseClassWithoutId { where: { id: guild_id, }, - relations: ["channels", "emojis", "members", "roles", "stickers"], + relations: ["channels", "emojis", "members", "roles", "stickers", "voice_states"], }); if (await Member.count({ id: user.id, guild: { id: guild_id } })) @@ -225,8 +225,6 @@ export class Member extends BaseClassWithoutId { mute: false, pending: false, }; - // @ts-ignore - guild.joined_at = member.joined_at.toISOString(); await Promise.all([ Member.insert({ @@ -255,7 +253,22 @@ export class Member extends BaseClassWithoutId { } as GuildMemberAddEvent), emitEvent({ event: "GUILD_CREATE", - data: { ...guild, members: [...guild.members, { ...member, user }] }, + data: { + ...guild, + members: [...guild.members, { ...member, user }], + member_count: (guild.member_count || 0) + 1, + guild_hashes: { + channels: { omitted: false, hash: "nkMQJ5nl5Cg" }, + metadata: { omitted: false, hash: "+5ybMfcb8iw" }, + roles: { omitted: false, hash: "Idhc6P9ktfM" }, + version: 1, + }, + guild_scheduled_events: [], + joined_at: member.joined_at, + presences: [], + stage_instances: [], + threads: [], + }, user_id, } as GuildCreateEvent), ]); diff --git a/util/src/interfaces/Event.ts b/util/src/interfaces/Event.ts index 7ea1bd49..acaa822e 100644 --- a/util/src/interfaces/Event.ts +++ b/util/src/interfaces/Event.ts @@ -125,6 +125,17 @@ export interface GuildCreateEvent extends Event { event: "GUILD_CREATE"; data: Guild & { joined_at: Date; + // TODO: add them to guild + guild_scheduled_events: never[]; + guild_hashes: { + channels: { omitted: boolean; hash: string }; + metadata: { omitted: boolean; hash: string }; + roles: { omitted: boolean; hash: string }; + version: number; + }; + presences: never[]; + stage_instances: never[]; + threads: never[]; }; } |