diff options
Diffstat (limited to 'util/src/entities/Member.ts')
-rw-r--r-- | util/src/entities/Member.ts | 21 |
1 files changed, 17 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), ]); |