diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 11:03:32 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-10 11:03:32 +0200 |
commit | dc85a79498941e4f38bf0e4e1bee4d83b6e35e80 (patch) | |
tree | 416dc2035ed9a0aff3db772044256a64bfa79b19 /gateway/src/opcodes/LazyRequest.ts | |
parent | :art: clean up dependencies (diff) | |
download | server-dc85a79498941e4f38bf0e4e1bee4d83b6e35e80.tar.xz |
:art: clean up imports + classes
Diffstat (limited to 'gateway/src/opcodes/LazyRequest.ts')
-rw-r--r-- | gateway/src/opcodes/LazyRequest.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gateway/src/opcodes/LazyRequest.ts b/gateway/src/opcodes/LazyRequest.ts index d37e32da..f5fd561a 100644 --- a/gateway/src/opcodes/LazyRequest.ts +++ b/gateway/src/opcodes/LazyRequest.ts @@ -41,6 +41,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { const items = []; for (const role of roles) { + // @ts-ignore const [role_members, other_members] = partition(members, (m: Member) => m.roles.find((r) => r.id === role.id) ); @@ -53,9 +54,12 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { groups.push(group); for (const member of role_members) { - member.roles = member.roles.filter((x) => x.id !== guild_id); + member.roles = member.roles.filter((x: Role) => x.id !== guild_id); items.push({ - member: { ...member, roles: member.roles.map((x) => x.id) }, + member: { + ...member, + roles: member.roles.map((x: Role) => x.id), + }, }); } members = other_members; @@ -84,7 +88,9 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { } function partition<T>(array: T[], isValid: Function) { + // @ts-ignore return array.reduce( + // @ts-ignore ([pass, fail], elem) => { return isValid(elem) ? [[...pass, elem], fail] |