2018-12-30 01:20:24 +01:00
|
|
|
const { Command } = require('discord-akairo');
|
2018-12-25 19:17:07 +01:00
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
class BanCommand extends Command {
|
2019-01-02 08:09:45 +01:00
|
|
|
constructor() {
|
|
|
|
super('ban', {
|
|
|
|
aliases: ['ban'],
|
|
|
|
category: 'admin',
|
|
|
|
args: [
|
|
|
|
{
|
|
|
|
id: 'member',
|
|
|
|
type: 'member'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'reasons',
|
2019-01-14 11:41:15 +01:00
|
|
|
type: 'string',
|
|
|
|
match: 'rest'
|
2019-01-02 08:09:45 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
clientPermissions: ['BAN_MEMBERS'],
|
|
|
|
userPermissions: ['BAN_MEMBERS'],
|
|
|
|
channelRestriction: 'guild',
|
|
|
|
description: {
|
|
|
|
content: 'Ban user',
|
|
|
|
usage: '[@user]',
|
|
|
|
examples: ['@user big dumb dumb']
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2018-09-07 19:07:10 +02:00
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
async exec(message, args) {
|
|
|
|
let member = args.member;
|
|
|
|
let reasons = args.reasons;
|
2018-12-30 01:20:24 +01:00
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
if(member == this.client)
|
|
|
|
return message.channel.send('Cant ban me fool');
|
|
|
|
if(!reasons)
|
|
|
|
reasons = 'Nothing have been specified';
|
|
|
|
if(member.id === message.author.id)
|
|
|
|
return message.channel.send('Why would you ban yourself ?');
|
2018-12-25 19:17:07 +01:00
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
member.ban(`Banned by : ${message.author.username} for the following reasons : ${reasons}`)
|
|
|
|
.then(() => message.reply(`${member.user.username} was succesfully banned with the following reasons "${reasons}".`));
|
|
|
|
}
|
2018-12-30 01:20:24 +01:00
|
|
|
}
|
2018-12-06 20:11:21 +01:00
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
module.exports = BanCommand;
|