diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-23 22:33:21 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-23 22:33:21 -0500 |
| commit | 3952227eae57ffe5c36b666322d4019e0c1f646b (patch) | |
| tree | 48649349fe83c35924d4be4d3b3af4649a58e7b1 /commands/softban.js | |
| parent | da95d55a81686080143452bbdbd326efd5f40a32 (diff) | |
| download | PokeBot-3952227eae57ffe5c36b666322d4019e0c1f646b.tar.gz PokeBot-3952227eae57ffe5c36b666322d4019e0c1f646b.tar.bz2 PokeBot-3952227eae57ffe5c36b666322d4019e0c1f646b.zip | |
Softban
Diffstat (limited to 'commands/softban.js')
| -rw-r--r-- | commands/softban.js | 21 |
1 files changed, 21 insertions, 0 deletions
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: '@<User> <...reason>', + category: 'Moderation', +}; |
