From c873b7074e20e2b4b9c848dc79373d46cc0e2bd5 Mon Sep 17 00:00:00 2001 From: Mathium05 <73901602+MathMan05@users.noreply.github.com> Date: Tue, 9 Sep 2025 17:30:24 -0500 Subject: [PATCH] Update Identify.ts --- src/gateway/opcodes/Identify.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index 9f0ed34b..5e2e28a2 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -268,9 +268,22 @@ export async function onIdentify(this: WebSocket, data: Payload) { // Generate guilds list ( make them unavailable if user is bot ) const guilds: GuildOrUnavailable[] = members.map((member) => { - // filter guild channels we don't have permission to view - // TODO: check if this causes issues when the user is granted other roles? member.guild.channels = member.guild.channels + /* + //TODO maybe implement this correctly, by causing create and delete events for users who can newly view and not view the channels, along with doing these checks correctly, as they don't currently take into account that the owner of the guild is always able to view channels, with potentially other issues + .filter((channel) => { + const perms = Permissions.finalPermission({ + user: { + id: member.id, + roles: member.roles.map((x) => x.id), + }, + guild: member.guild, + channel, + }); + + return perms.has("VIEW_CHANNEL"); + }) + */ .map((channel) => { channel.position = member.guild.channel_ordering.indexOf( channel.id,