From ac80272cd08b7a5044c560f96afc169f2dec3a77 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Mon, 5 Apr 2021 10:41:17 -0500 Subject: [PATCH] Allow members with ban permissions to ban others --- bot.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.js b/bot.js index 3080cb0..ae49069 100644 --- a/bot.js +++ b/bot.js @@ -449,8 +449,8 @@ async function addRole(message) { } async function ban(message) { - if (!message.member.hasPermission('ADMINISTRATOR')) { - message.reply('you do not have admin privileges!') + if (!message.member.hasPermission('BAN_MEMBERS')) { + message.reply('you do not have ban permissions!') return; } @@ -484,6 +484,10 @@ async function ban(message) { return; } + if (member.roles.highest.comparePositionTo(message.member.roles.highest) > 0) { + message.reply("this member is above you!") + } + let verificationEmbed = new Discord.MessageEmbed() .setTitle(`Are you sure you would like to ban \`${member.user.tag}\`?`) .setAuthor(member.user.tag, member.user.avatarURL())