diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-04 11:25:40 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-04 11:25:40 +0200 |
commit | 82341300fce65a23f1f5c425b31dd9cb645f7f83 (patch) | |
tree | c2c378fa46b3fe26602619c107eff6b68f55ddab /gateway/src | |
parent | :bug: fix invites (diff) | |
download | server-82341300fce65a23f1f5c425b31dd9cb645f7f83.tar.xz |
:bug: fix ready members payload
Diffstat (limited to 'gateway/src')
-rw-r--r-- | gateway/src/opcodes/Identify.ts | 15 |
1 files changed, 12 insertions, 3 deletions
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); |