galactic-bot/structure/client/components/commands/moderation/Unmute.js

58 lines
1.6 KiB
JavaScript
Raw Normal View History

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,
2020-07-20 00:42:21 +02:00
showUsage: true,
throttling: {
usages: 2,
duration: 5
}
});
}
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;