Haha-Yes/commands/admin/kick.js

47 lines
1.4 KiB
JavaScript
Raw Normal View History

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 KickCommand extends Command {
constructor() {
super('kick', {
aliases: ['kick'],
category: 'admin',
2018-12-30 06:52:10 +01:00
split: 'quoted',
2018-12-30 01:20:24 +01:00
args: [
{
id: 'member',
type: 'member'
},
{
id: 'reasons',
type: 'string'
}
],
clientPermissions: ['KICK_MEMBERS'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'Kick user',
usage: '[@user]',
examples: ['@user big dumb dumb']
}
2018-09-07 19:07:10 +02:00
});
}
2018-12-30 01:20:24 +01:00
async exec(message, args) {
let member = args.member;
let reasons = args.reasons;
if(member === this.client.user)
return message.channel.say('Cant kick me fool');
2018-09-28 16:16:35 +02:00
if(member.id === message.author.id)
2018-12-30 01:20:24 +01:00
return message.channel.say("Why would you kick yourself ?");
if(!reasons)
reasons = 'Nothing have been specified.';
await member.kick(`Kicked by : ${message.author.username} for the following reasons : ${reasons}`)
2018-12-06 20:11:21 +01:00
.then(() => message.reply(`${member.user.username} was succesfully kicked with the following reasons "${reasons}".`))
2018-12-30 01:20:24 +01:00
.catch(err => console.error(err))
}
}
module.exports = KickCommand;