Browse Source

Allow members with ban permissions to ban others

master
Abheek Dhawan 4 years ago
parent
commit
ac80272cd0
  1. 8
      bot.js

8
bot.js

@ -449,8 +449,8 @@ async function addRole(message) {
} }
async function ban(message) { async function ban(message) {
if (!message.member.hasPermission('ADMINISTRATOR')) { if (!message.member.hasPermission('BAN_MEMBERS')) {
message.reply('you do not have admin privileges!') message.reply('you do not have ban permissions!')
return; return;
} }
@ -484,6 +484,10 @@ async function ban(message) {
return; return;
} }
if (member.roles.highest.comparePositionTo(message.member.roles.highest) > 0) {
message.reply("this member is above you!")
}
let verificationEmbed = new Discord.MessageEmbed() let verificationEmbed = new Discord.MessageEmbed()
.setTitle(`Are you sure you would like to ban \`${member.user.tag}\`?`) .setTitle(`Are you sure you would like to ban \`${member.user.tag}\`?`)
.setAuthor(member.user.tag, member.user.avatarURL()) .setAuthor(member.user.tag, member.user.avatarURL())

Loading…
Cancel
Save