78 lines
2.0 KiB
JavaScript
78 lines
2.0 KiB
JavaScript
|
/*
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
HEY YOU! THIS ISNT FINISHED. I JUST COMMITED IT BECAUSE WHY THE FUCK NOT
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
*/
|
||
|
|
||
|
const { Command } = require('../../../../interfaces/');
|
||
|
const { Addrole } = require('../../../../moderation/infractions/');
|
||
|
|
||
|
class AddroleCommand extends Command {
|
||
|
|
||
|
constructor(client) {
|
||
|
|
||
|
super(client, {
|
||
|
name: 'addrole',
|
||
|
module: 'moderation',
|
||
|
aliases: [
|
||
|
'roleadd'
|
||
|
],
|
||
|
usage: "<member..> <role..> [reason]",
|
||
|
clientPermissions: ['MANAGE_ROLES'],
|
||
|
memberPermissions: ['MANAGE_ROLES'],
|
||
|
examples: [],
|
||
|
arguments: [
|
||
|
{
|
||
|
name: 'silent',
|
||
|
type: 'BOOLEAN',
|
||
|
types: ['FLAG'],
|
||
|
default: true
|
||
|
}
|
||
|
],
|
||
|
guildOnly: true,
|
||
|
showUsage: true,
|
||
|
disabled: true //REMOVE THIS
|
||
|
});
|
||
|
}
|
||
|
|
||
|
async execute(message, { params }) {
|
||
|
|
||
|
const { parsed: members, parameters: temporaryParameters } = await this.client.resolver.infinite(params, [
|
||
|
this.client.resolver.resolveMember.bind(this.client.resolver)
|
||
|
], true, message.guild);
|
||
|
|
||
|
if(members.length === 0) return message.respond(message.format('C_ADDROLE_MISSINGMEMBERS'), {
|
||
|
emoji: 'failure'
|
||
|
});
|
||
|
|
||
|
const { parsed: roles, parameters } = await this.client.resolver.infinite(temporaryParameters, [
|
||
|
this.client.resolver.resolveRole.bind(this.client.resolver)
|
||
|
], true, message.guild);
|
||
|
|
||
|
if(roles.length === 0) return message.respond(message.format('C_ADDROLE_MISSINGROLES'), {
|
||
|
emoji: 'failure'
|
||
|
});
|
||
|
|
||
|
return this.client.moderationManager
|
||
|
.handleInfraction(Addrole, message, {
|
||
|
targets: members,
|
||
|
data: {
|
||
|
roles
|
||
|
},
|
||
|
reason: parameters.join(' ')
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
module.exports = AddroleCommand;
|