aboutsummaryrefslogtreecommitdiff
path: root/commands/ban.js
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-02-23 22:23:29 -0500
committerAlee <alee14498@gmail.com>2018-02-23 22:23:29 -0500
commitec4fd3ed863dffa27c2ddaf8d702f8aa27f174ff (patch)
tree5726c60ece3d83d843255b6889648f046faf6169 /commands/ban.js
parentf6f3acc995ae4570943c2884549d9903db865539 (diff)
downloadPokeBot-ec4fd3ed863dffa27c2ddaf8d702f8aa27f174ff.tar.gz
PokeBot-ec4fd3ed863dffa27c2ddaf8d702f8aa27f174ff.tar.bz2
PokeBot-ec4fd3ed863dffa27c2ddaf8d702f8aa27f174ff.zip
Adding the foundations of the ban command
Diffstat (limited to 'commands/ban.js')
-rw-r--r--commands/ban.js21
1 files changed, 21 insertions, 0 deletions
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: '@<User> <...reason>',
+ category: 'Moderation',
+ };
+ \ No newline at end of file