54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
|
const { Command } = require('../../../../interfaces/');
|
||
|
const { Unmute } = require('../../../../moderation/infractions/');
|
||
|
|
||
|
class UnmuteCommand extends Command {
|
||
|
|
||
|
constructor(client) {
|
||
|
|
||
|
super(client, {
|
||
|
name: 'unmute',
|
||
|
module: 'moderation',
|
||
|
aliases: [
|
||
|
'untempmute'
|
||
|
],
|
||
|
usage: "<member..> [reason]",
|
||
|
clientPermissions: ['MANAGE_ROLES'],
|
||
|
memberPermissions: ['MANAGE_ROLES'],
|
||
|
examples: [
|
||
|
"@nolan#2887 @Navy.gif#1998 they apologized"
|
||
|
],
|
||
|
keepQuotes: true,
|
||
|
arguments: [
|
||
|
{
|
||
|
name: 'silent',
|
||
|
type: 'BOOLEAN',
|
||
|
types: ['FLAG'],
|
||
|
default: true
|
||
|
}
|
||
|
],
|
||
|
guildOnly: true,
|
||
|
showUsage: true
|
||
|
});
|
||
|
}
|
||
|
|
||
|
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_UNMUTE_MISSINGMEMBERS'), {
|
||
|
emoji: 'failure'
|
||
|
});
|
||
|
|
||
|
return this.client.moderationManager
|
||
|
.handleInfraction(Unmute, message, {
|
||
|
targets: parsed,
|
||
|
reason: parameters.join(' ')
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
module.exports = UnmuteCommand;
|