From 3952227eae57ffe5c36b666322d4019e0c1f646b Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 23 Feb 2018 22:33:21 -0500 Subject: Softban --- commands/softban.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 commands/softban.js (limited to 'commands') diff --git a/commands/softban.js b/commands/softban.js new file mode 100644 index 0000000..acd29fc --- /dev/null +++ b/commands/softban.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.ban({ days: 7, reason: msg.author.tag + ': ' + args.join(' ').slice(3 + member.user.id.length) }).then(() => { + msg.guild.unban(member.user.id); + msg.channel.send(`Alright, I softbanned **${member.user.tag}** for the reason **${args.join(' ').slice(3 + member.user.id.length)}**`); + }); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'softban', + description: 'Kick the user and delete their messages', + usage: '@ <...reason>', + category: 'Moderation', +}; -- cgit v1.2.3