Report Respond Command

This commit is contained in:
Dragon Fire
2020-07-16 20:23:46 -04:00
parent d0964307e0
commit cdffbfebd0
3 changed files with 54 additions and 1 deletions
+52
View File
@@ -0,0 +1,52 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { list } = require('../../util/Util');
const types = ['reject', 'info', 'approve'];
const typesColors = ['RED', 'YELLOW', 'GREEN'];
const displaytypes = ['❌ Rejected', '❓ Need More Info', '✅ Accepted/Fixed'];
module.exports = class ReportRespondCommand extends Command {
constructor(client) {
super(client, {
name: 'report-respond',
aliases: ['report-res'],
group: 'util',
memberName: 'report-respond',
description: 'Responds to a submitted report.',
details: 'Only the bot owner(s) may use this command.',
guarded: true,
ownerOnly: true,
args: [
{
key: 'user',
prompt: 'What user do you want to respond to?',
type: 'user'
},
{
key: 'type',
prompt: `What is the reason for your report? Either ${list(types, 'or')}.`,
type: 'string',
oneOf: types,
parse: type => types.indexOf(type.toLowerCase())
},
{
key: 'message',
prompt: 'What response do you want to send?',
type: 'string'
}
]
});
}
async run(msg, { user, type, message }) {
const embed = new MessageEmbed()
.setDescription(message)
.setTitle(displaytypes[type])
.setAuthor(msg.author.tag)
.setFooter(`ID: ${msg.author.id}`)
.setTimestamp()
.setColor(typesColors[type]);
await user.send('Your report has been evaluated with the following message:', { embed });
return msg.say(`${displaytypes[type]} sent to ${user.tag}.`);
}
};