From 72e2c2bcd98420393bfc541b80f670aa1dce797a Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Sat, 26 Nov 2022 19:52:43 +1100 Subject: [PATCH] fix perms ?bug? --- src/events/roleUpdate.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/events/roleUpdate.ts b/src/events/roleUpdate.ts index ee8430c..fdf4e0d 100644 --- a/src/events/roleUpdate.ts +++ b/src/events/roleUpdate.ts @@ -3,11 +3,11 @@ import { TClient } from '../client'; export default { name: 'roleUpdate', execute: async(client:TClient, oldRole:Discord.Role, newRole:Discord.Role)=>{ - if (oldRole.guild?.id != client.config.mainServer.id) return; const fetchRoleUpdoot = await client.guilds.cache.get(oldRole.guild.id).fetchAuditLogs({ limit: 1, type: AuditLogEvent.RoleUpdate }) + if (oldRole.guild?.id != client.config.mainServer.id) return; const roleLog = fetchRoleUpdoot.entries.first(); if (!roleLog) return const {executor, target} = roleLog; @@ -22,8 +22,8 @@ export default { embed.addFields({name: '🔹 Role changes', value: `**Old color:** ${oldRole.hexColor}\n**New color:** ${newRole.hexColor}`}) } else if (oldRole.name !== newRole.name) { embed.addFields({name: '🔹 Role changes', value: `**Old name:** ${oldRole.name}\n**New name:** ${newRole.name}`}) - } else if (oldRole.permissions !== newRole.permissions) { - embed.addFields({name: '🔹 Role changes', value: `**Old permission(s):** ${newRole.permissions.missing(oldRole.permissions)}\n**New permission(s):** ${oldRole.permissions.missing(newRole.permissions)}`}) + } else if (!oldRole.permissions.equals(newRole.permissions)) { + embed.addFields({name: '🔹 Role changes', value: `**Old permission(s):** ${newRole.permissions.missing(oldRole.permissions).join(', ')}\n**New permission(s):** ${oldRole.permissions.missing(newRole.permissions).join(', ')}`}) } } else { console.log(`${target.id} was modified from ${client.guilds.cache.get(oldRole.guild.name)} but no audit log could be fetched.`)