Haha-Yes/commands/admin/kick.js

31 lines
967 B
JavaScript
Raw Normal View History

2018-09-07 19:07:10 +02:00
const { Command } = require('discord.js-commando');
module.exports = class KickCommand extends Command {
constructor(client) {
super(client, {
name: 'kick',
group: 'admin',
memberName: 'kick',
description: 'Kick the mentionned user',
guildOnly: true,
2018-09-07 23:57:57 +02:00
clientPermissions: ['KICK_MEMBERS'],
2018-09-07 19:07:10 +02:00
userPermissions: ['KICK_MEMBERS'],
guildOnly: true,
2018-09-07 19:07:10 +02:00
args: [
{
key: 'member',
prompt: 'Wich member would you like to kick?',
type: 'member',
}
]
});
}
2018-09-23 00:58:33 +02:00
async run(message, { member }) {
if(member.id === message.author.id) {
message.say("Why would you kick yourself ?")
} else
2018-09-16 03:23:13 +02:00
member.kick().then(member => {
2018-09-07 22:47:49 +02:00
message.reply(`${member.user.username} was succesfully kicked.`);
2018-09-07 19:07:10 +02:00
});
}
};