You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1016 B
36 lines
1016 B
|
|
|
|
const {Command, ErrorMessage, ErrorType} = require('../../lib.js')
|
|
|
|
class kick extends Command{
|
|
constructor(client){
|
|
super(client, {
|
|
name: 'kick',
|
|
group:'admin',
|
|
memberName: 'kick',
|
|
description: 'Kicks a member from the server.',
|
|
needsAdmin:true,
|
|
hidden:true,
|
|
|
|
})
|
|
this.client = client;
|
|
}
|
|
async run(message, args){
|
|
|
|
const user = message.mentions.users.first();
|
|
// Check if the user mentioned exists and is not a bot
|
|
if (!user || user.bot) {
|
|
return new ErrorMessage(this.client).send(ErrorType.Arguments, message, ['User is a bot, or you sent something wrong.'])
|
|
}
|
|
|
|
// Kick the user
|
|
try {
|
|
await user.kick();
|
|
return message.channel.send(`${user.tag} was kicked from the server.`);
|
|
} catch (error) {
|
|
return console.log(`Kick: An error occurred: ${error.message}`);
|
|
}
|
|
}
|
|
}module.exports = kick;
|
|
|