From 421cf4c3db9a2810285b123dfd82f116f81d0fa7 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 12 Aug 2021 16:47:52 +0200 Subject: :sparkles: rabbitmq --- src/opcodes/LazyRequest.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/opcodes/LazyRequest.ts') diff --git a/src/opcodes/LazyRequest.ts b/src/opcodes/LazyRequest.ts index 8a7bb8c4..b1d553b9 100644 --- a/src/opcodes/LazyRequest.ts +++ b/src/opcodes/LazyRequest.ts @@ -23,6 +23,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { const { guild_id, typing, channels, activities } = d as LazyRequest; const permissions = await getPermission(this.user_id, guild_id); + permissions.hasThrow("VIEW_CHANNEL"); // MongoDB query to retrieve all hoisted roles and join them with the members and users collection const roles = toObject( @@ -70,16 +71,16 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { const items = []; for (const role of roles) { - items.push({ - group: { - count: role.members.length, - id: role.id === guild_id ? "online" : role.name - } - }); - for (const member of role.members) { - member.roles.remove(guild_id); - items.push({ member }); - } + items.push({ + group: { + count: role.members.length, + id: role.id === guild_id ? "online" : role.name, + }, + }); + for (const member of role.members) { + member.roles.remove(guild_id); + items.push({ member }); + } } return Send(this, { -- cgit 1.5.1