From 3209216cff9a5e307e87fa955d44dbcc5928f098 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 19 Jul 2021 22:20:14 +0300 Subject: [PATCH] add check for ban perm to view bans --- structure/ChannelHandler.js | 8 +++++--- structure/Modmail.js | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/structure/ChannelHandler.js b/structure/ChannelHandler.js index 9fa6abd..319669e 100644 --- a/structure/ChannelHandler.js +++ b/structure/ChannelHandler.js @@ -142,9 +142,11 @@ class ChannelHandler { color: guild.me.highestRoleColor }; if (member && member.inAppealServer) { - const ban = await guild.fetchBan(member.id).catch(() => null); - if (ban) embed.description = `**__USER IS BANNED FROM MAIN SERVER__**`; - else embed.description = `**__USER IS IN APPEAL SERVER BUT NOT BANNED FROM MAIN__**`; + if (guild.me.hasPermission('BAN_MEMBERS')) { + const ban = await guild.fetchBan(member.id).catch(() => null); + if (ban) embed.description = `**__USER IS BANNED FROM MAIN SERVER__**`; + else embed.description = `**__USER IS IN APPEAL SERVER BUT NOT BANNED FROM MAIN__**`; + } else embed.description = `**__USER IS IN APPEAL SERVER__**`; } else if (member) embed.fields.push({ name: '__Member Data__', value: `**Nickname:** ${member.nickname || 'N/A'}\n` + diff --git a/structure/Modmail.js b/structure/Modmail.js index cf2906d..1e318b5 100644 --- a/structure/Modmail.js +++ b/structure/Modmail.js @@ -251,8 +251,6 @@ class Modmail { await message.channel.send('Delivered.').catch(this.client.logger.error.bind(this.client.logger)); this.log({ author, action: `${author.tag} sent a message to ${targetMember.user.tag}`, content, target: targetMember.user }); - - } async send({ target, staff, anon, content }) {