From f11f09ee6ddbd347e65f58528033d8ed78ed22ea Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 19 Oct 2018 12:54:26 +0200 Subject: [PATCH] hackban --- commands/admin/hackban.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 commands/admin/hackban.js diff --git a/commands/admin/hackban.js b/commands/admin/hackban.js new file mode 100644 index 00000000..bf032b97 --- /dev/null +++ b/commands/admin/hackban.js @@ -0,0 +1,36 @@ +const { Command } = require('discord.js-commando'); +module.exports = class BanCommand extends Command { + constructor(client) { + super(client, { + name: 'hackban', + group: 'admin', + memberName: 'hackban', + description: 'ban the mentionned user even if they are not in the server (with id)', + guildOnly: true, + clientPermissions: ['BAN_MEMBERS'], + userPermissions: ['BAN_MEMBERS'], + args: [ + { + key: 'user', + prompt: 'Wich user would you like to ban?', + type: 'user', + }, + { + key: 'reasons', + prompt: 'What is the reasons of the kick', + type: 'string', + default: '' + } + ] + }); + } + + async run(message, { user, reasons }) { + if(!reasons) + reasons = 'Nothing have been specified' + if(user.id === message.author.id) + return message.say("Why would you ban yourself ?") + message.guild.ban(user, `Banned by : ${message.author.username} for the following reasons : ${reasons}`) + .then(() => message.reply(`${user} was succesfully banned with the following reasons "${reasons}".`)); + }; +}; \ No newline at end of file