1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/admin/kick.js

48 lines
1.3 KiB
JavaScript

const { Command } = require('discord-akairo');
6 years ago
class KickCommand extends Command {
6 years ago
constructor() {
super('kick', {
aliases: ['kick'],
category: 'admin',
args: [
{
id: 'member',
type: 'member'
},
{
id: 'reasons',
type: 'string',
match: 'rest'
6 years ago
}
],
clientPermissions: ['KICK_MEMBERS'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'Kick user',
usage: '[@user]',
examples: ['@user big dumb dumb']
}
});
}
6 years ago
6 years ago
async exec(message, args) {
let member = args.member;
let reasons = args.reasons;
6 years ago
if(member === this.client.user)
return message.channel.say('Cant kick me fool');
if(member.id === message.author.id)
return message.channel.say('Why would you kick yourself ?');
if(!reasons)
reasons = 'Nothing have been specified.';
await member.send(`You have been kicked from **${message.guild.name}** for the following reasons: "**${reasons}**"`);
return member.kick(`Kicked by : ${message.author.username} for the following reasons : ${reasons}`)
6 years ago
.then(() => message.reply(`${member.user.username} was succesfully kicked with the following reasons "${reasons}".`))
.catch(err => console.error(err));
}
}
module.exports = KickCommand;