Cant kick/ban urself

This commit is contained in:
Loic Bersier 2018-09-23 00:58:33 +02:00
parent 8bde63f24e
commit 6773a3e391
2 changed files with 8 additions and 4 deletions

View file

@ -20,8 +20,10 @@ module.exports = class BanCommand extends Command {
}); });
} }
async run(message) { async run(message, { member }) {
const member = message.mentions.members.first(); if(member.id === message.author.id) {
message.say("Why would you ban yourself ?")
} else
member.ban().then(member => { member.ban().then(member => {
message.reply(`${member.user.username} was succesfully banned.`); message.reply(`${member.user.username} was succesfully banned.`);
}); });

View file

@ -20,8 +20,10 @@ module.exports = class KickCommand extends Command {
}); });
} }
async run(message) { async run(message, { member }) {
const member = message.mentions.members.first(); if(member.id === message.author.id) {
message.say("Why would you kick yourself ?")
} else
member.kick().then(member => { member.kick().then(member => {
message.reply(`${member.user.username} was succesfully kicked.`); message.reply(`${member.user.username} was succesfully kicked.`);
}); });