mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Report Respond Command
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.17.5",
|
||||
"version": "119.18.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user