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
+1
View File
@@ -280,6 +280,7 @@ Total: 535
* **generate-fun-information:** Generates the "Fun Information" for Xiao's README. (Owner-Only)
* **generate-process-env:** Generates a backup list of Xiao's `process.env`. (Owner-Only)
* **ip:** Responds with the IP address the bot's server is running on. (Owner-Only)
* **report-respond:** Responds to a submitted report. (Owner-Only)
* **shutdown:** Shuts down the bot. (Owner-Only)
* **webhook:** Posts a message to the webhook defined in the bot owner's `process.env`. (Owner-Only)
+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}.`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.17.5",
"version": "119.18.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {