From 6773a3e39189d85ac216bd4e24bc2b21b80ac5ad Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Sun, 23 Sep 2018 00:58:33 +0200 Subject: [PATCH] Cant kick/ban urself --- commands/admin/ban.js | 6 ++++-- commands/admin/kick.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/commands/admin/ban.js b/commands/admin/ban.js index 68773257..7d1efd1b 100644 --- a/commands/admin/ban.js +++ b/commands/admin/ban.js @@ -20,8 +20,10 @@ module.exports = class BanCommand extends Command { }); } - async run(message) { - const member = message.mentions.members.first(); + async run(message, { member }) { + if(member.id === message.author.id) { + message.say("Why would you ban yourself ?") + } else member.ban().then(member => { message.reply(`${member.user.username} was succesfully banned.`); }); diff --git a/commands/admin/kick.js b/commands/admin/kick.js index 00b72ed0..77105c2d 100644 --- a/commands/admin/kick.js +++ b/commands/admin/kick.js @@ -20,8 +20,10 @@ module.exports = class KickCommand extends Command { }); } - async run(message) { - const member = message.mentions.members.first(); + async run(message, { member }) { + if(member.id === message.author.id) { + message.say("Why would you kick yourself ?") + } else member.kick().then(member => { message.reply(`${member.user.username} was succesfully kicked.`); });