diff --git a/README.md b/README.md index db95dc42..d524677d 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Xiao is a Discord bot coded in JavaScript with ## Commands -Total: 359 +Total: 360 ### Utility: @@ -105,6 +105,7 @@ Total: 359 * **ip:** Responds with the IP address Xiao's server is running on. * **options:** Responds with a list of server options. * **ping:** Checks the bot's ping to the Discord server. +* **report:** Reports something to the bot owner(s). ### Discord Information: diff --git a/commands/util/report.js b/commands/util/report.js new file mode 100644 index 00000000..2f4a1f63 --- /dev/null +++ b/commands/util/report.js @@ -0,0 +1,51 @@ +const Command = require('../../structures/Command'); +const MessageEmbed = require('../../structures/MessageEmbed'); +const { list } = require('../../util/Util'); +const reasons = ['bug', 'feedback', 'suggestion']; +const reasonColors = ['red', 'green', 'yellow']; +const displayReasons = ['Bug Report', 'Feedback', 'Suggestion']; + +module.exports = class ReportCommand extends Command { + constructor(client) { + super(client, { + name: 'report', + aliases: ['bug', 'report-bug', 'feedback', 'contact', 'suggest', 'suggestion'], + group: 'util', + memberName: 'report', + description: 'Reports something to the bot owner(s).', + guarded: true, + clientPermissions: ['EMBED_LINKS'], + args: [ + { + name: 'reason', + prompt: `What is the reason for your report? Either ${list(reasons, 'or')}.`, + type: 'string', + oneOf: reasons, + parse: reason => reasons.indexOf(reason.toLowerCase()) + }, + { + name: 'message', + prompt: 'What is the message of your report?', + type: 'string' + } + ] + }); + } + + async run(msg, { reason, message }) { + const embed = new MessageEmbed() + .setDescription(message) + .setTitle(displayReasons[reason]) + .setAuthor(msg.author.tag) + .setTimestamp() + .setColor(reasonColors[reason]); + for (const owner of this.client.owners){ + try { + await owner.send(embed); + } catch (err) { + continue; + } + } + return msg.say(`**${displayReasons[reason]}** sent! Thank you!`); + } +}; diff --git a/package.json b/package.json index b4069c48..9f721e66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "110.6.1", + "version": "110.7.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {