Skip to content
Snippets Groups Projects
Commit 8ee45768 authored by Reviath's avatar Reviath
Browse files

Fixed kick and ban commands.

parent c4287b9d
Branches
No related tags found
No related merge requests found
......@@ -9,6 +9,14 @@ exports.run = async(client, message, args) => {
if(!reason){
reason = "Unspecified";
}
let authorHighestRole = message.member.highestRole.position;
let mentionHighestRole = user.highestRole.position;
if(mentionHighestRole >= authorHighestRole) {
message.channel.send('You can`t ban members with equal or higher position');
return;
};
if (!message.guild.member(user).bannable) return message.reply(`I don't have enough permission.`);
message.guild.members.ban(user, {days: 7, reason: reason}).catch(e => {
message.channel.send(`An error occurred \n${e}`)
......
......@@ -10,6 +10,13 @@ if (!message.member.hasPermission('KICK_MEMBERS')) return [message.channel.send(
if(!reason) {
reason = "Unspecified"
};
let authorHighestRole = message.member.highestRole.position;
let mentionHighestRole = user.highestRole.position;
if(mentionHighestRole >= authorHighestRole) {
message.channel.send('You can`t kick members with equal or higher position');
return;
};
if (!message.guild.member(user).kickable) return message.reply(`I don't have enough permission.`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment