2020-06-02 12:09:28 +02:00
|
|
|
const { Command } = require('../../../../interfaces/');
|
|
|
|
const { Kick } = require('../../../../moderation/infractions/');
|
|
|
|
|
|
|
|
class KickCommand extends Command {
|
|
|
|
|
|
|
|
constructor(client) {
|
|
|
|
|
|
|
|
super(client, {
|
|
|
|
name: 'kick',
|
|
|
|
module: 'moderation',
|
|
|
|
usage: "<member..> [reason]",
|
|
|
|
clientPermissions: ['KICK_MEMBERS'],
|
|
|
|
memberPermissions: ['KICK_MEMBERS'],
|
|
|
|
examples: [
|
|
|
|
"@nolan#2887 @Navy.gif#1998 breaking the rules"
|
|
|
|
],
|
|
|
|
keepQuotes: true,
|
|
|
|
arguments: [
|
|
|
|
{
|
|
|
|
name: 'points',
|
|
|
|
aliases: ['point', 'modpoints', 'modpoint', 'pts', 'pt'],
|
|
|
|
type: 'INTEGER',
|
2020-06-04 19:59:09 +02:00
|
|
|
types: ['VERBAL', 'FLAG'],
|
2020-06-02 12:09:28 +02:00
|
|
|
usage: '<amount>',
|
|
|
|
default: (guild) => {
|
|
|
|
return guild._settings.moderationPoints.points.KICK;
|
|
|
|
},
|
|
|
|
min: 0, max: 100,
|
|
|
|
ignoreInvalid: true,
|
|
|
|
required: true
|
|
|
|
},
|
2020-06-04 19:59:09 +02:00
|
|
|
{
|
|
|
|
name: 'expiration',
|
|
|
|
aliases: ['expire', 'expires', 'expirations'],
|
|
|
|
type: 'TIME',
|
|
|
|
types: ['FLAG'],
|
|
|
|
usage: '<time>',
|
|
|
|
default: (guild) => {
|
|
|
|
return guild._settings.moderationPoints.expirations.KICK;
|
|
|
|
}
|
|
|
|
},
|
2020-06-02 12:09:28 +02:00
|
|
|
{
|
|
|
|
name: 'prune',
|
|
|
|
aliases: ['purge'],
|
|
|
|
type: 'INTEGER',
|
|
|
|
types: ['FLAG'],
|
|
|
|
usage: '<amount>',
|
|
|
|
default: 50,
|
|
|
|
min: 2, max: 50,
|
|
|
|
ignoreInvalid: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'force',
|
|
|
|
type: 'BOOLEAN',
|
|
|
|
types: ['FLAG'],
|
|
|
|
default: true
|
2020-06-04 19:59:09 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'silent',
|
|
|
|
type: 'BOOLEAN',
|
|
|
|
types: ['FLAG'],
|
|
|
|
default: true
|
2020-06-02 12:09:28 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
guildOnly: true,
|
2020-07-20 00:42:21 +02:00
|
|
|
showUsage: true,
|
|
|
|
throttling: {
|
|
|
|
usages: 2,
|
|
|
|
duration: 5
|
|
|
|
}
|
2020-06-02 12:09:28 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
this.client = client;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
async execute(message, { params }) {
|
|
|
|
|
|
|
|
const { parsed, parameters } = await this.client.resolver.infinite(params, [
|
|
|
|
this.client.resolver.resolveMember.bind(this.client.resolver)
|
|
|
|
], true, message.guild);
|
|
|
|
|
|
|
|
if(parsed.length === 0) {
|
|
|
|
return message.respond(message.format('C_KICK_MISSINGMEMBERS'), {
|
|
|
|
emoji: 'failure'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.client.moderationManager
|
|
|
|
.handleInfraction(Kick, message, {
|
|
|
|
targets: parsed,
|
2020-07-04 12:23:10 +02:00
|
|
|
reason: parameters.join(' ')
|
2020-06-02 12:09:28 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = KickCommand;
|