From bf81e9c352e6ab1b76dae6a50cc768281f5c0bf4 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 4 Sep 2021 11:25:40 +0200 Subject: :bug: fix ready members payload --- gateway/src/opcodes/Identify.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'gateway/src/opcodes/Identify.ts') diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts index cd09653f..adfd98da 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts @@ -12,6 +12,8 @@ import { EVENTEnum, Config, dbConnection, + PublicMemberProjection, + PublicMember, } from "@fosscord/util"; import { setupListener } from "../listener/listener"; import { IdentifySchema } from "../schema/Identify"; @@ -68,9 +70,16 @@ export async function onIdentify(this: WebSocket, data: Payload) { "roles", ], }); - const merged_members = members.map((x: any) => { - return [x]; - }) as Member[][]; + const merged_members = members.map((x: Member) => { + return [ + { + ...x, + roles: x.roles.map((x) => x.id), + settings: undefined, + guild: undefined, + }, + ]; + }) as PublicMember[][]; const guilds = members.map((x) => ({ ...x.guild, joined_at: x.joined_at })); const user_guild_settings_entries = members.map((x) => x.settings); -- cgit 1.4.1