From ec4fd3ed863dffa27c2ddaf8d702f8aa27f174ff Mon Sep 17 00:00:00 2001 From: Alee Date: Fri, 23 Feb 2018 22:23:29 -0500 Subject: Adding the foundations of the ban command --- commands/ban.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 commands/ban.js (limited to 'commands') diff --git a/commands/ban.js b/commands/ban.js new file mode 100644 index 0000000..6b489b5 --- /dev/null +++ b/commands/ban.js @@ -0,0 +1,21 @@ +exports.run = (bot, msg, args) => { + if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permssion to ban members'); + if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permssion to ban members'); + const member = msg.mentions.members.first(); + member.kick(msg.author.tag + ': ' + args.join(' ').slice(3 + member.user.id.length)).then(() => { + msg.channel.send(`Alright, I banned **${member.user.tag}** for the reason **${args.join(' ').slice(3 + member.user.id.length)}**`); + }); + }; + + exports.conf = { + aliases: [], + guildOnly: true, + }; + + exports.help = { + name: 'ban', + description: 'Ban a user out of the server', + usage: '@ <...reason>', + category: 'Moderation', + }; + \ No newline at end of file -- cgit v1.2.3