From d405acafd3cdfd832f5c2da152cb6486f5c3ad2b Mon Sep 17 00:00:00 2001 From: lilyissillyyy Date: Sat, 6 Sep 2025 17:38:12 -0400 Subject: [PATCH] Add a bunch of report shortcut subcommands --- commands/util-public/feedback.js | 22 ++++++++++++++++++++++ commands/util-public/report-abuse.js | 23 +++++++++++++++++++++++ commands/util-public/report-bug.js | 23 +++++++++++++++++++++++ commands/util-public/report.js | 2 +- commands/util-public/suggest.js | 23 +++++++++++++++++++++++ framework/Command.js | 1 + package.json | 2 +- 7 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 commands/util-public/feedback.js create mode 100644 commands/util-public/report-abuse.js create mode 100644 commands/util-public/report-bug.js create mode 100644 commands/util-public/suggest.js diff --git a/commands/util-public/feedback.js b/commands/util-public/feedback.js new file mode 100644 index 00000000..d2568875 --- /dev/null +++ b/commands/util-public/feedback.js @@ -0,0 +1,22 @@ +const Command = require('../../framework/Command'); + +module.exports = class FeedbackCommand extends Command { + constructor(client) { + super(client, { + name: 'feedback', + group: 'util-public', + description: 'Shortcut to send feedback.', + guarded: true, + args: [ + { + key: 'message', + type: 'string' + } + ] + }); + } + + run(msg, { message }) { + return this.client.registry.commands.get('report').run(msg, { reason: 'feedback', message }); + } +}; diff --git a/commands/util-public/report-abuse.js b/commands/util-public/report-abuse.js new file mode 100644 index 00000000..a8b9180f --- /dev/null +++ b/commands/util-public/report-abuse.js @@ -0,0 +1,23 @@ +const Command = require('../../framework/Command'); + +module.exports = class ReportAbuseCommand extends Command { + constructor(client) { + super(client, { + name: 'report-abuse', + aliases: ['abuse'], + group: 'util-public', + description: 'Shortcut to report abuse.', + guarded: true, + args: [ + { + key: 'message', + type: 'string' + } + ] + }); + } + + run(msg, { message }) { + return this.client.registry.commands.get('report').run(msg, { reason: 'abuse', message }); + } +}; diff --git a/commands/util-public/report-bug.js b/commands/util-public/report-bug.js new file mode 100644 index 00000000..3a101b6a --- /dev/null +++ b/commands/util-public/report-bug.js @@ -0,0 +1,23 @@ +const Command = require('../../framework/Command'); + +module.exports = class ReportBugCommand extends Command { + constructor(client) { + super(client, { + name: 'report-bug', + aliases: ['bug', 'report-suggestion'], + group: 'util-public', + description: 'Shortcut to report a bug.', + guarded: true, + args: [ + { + key: 'message', + type: 'string' + } + ] + }); + } + + run(msg, { message }) { + return this.client.registry.commands.get('report').run(msg, { reason: 'bug', message }); + } +}; diff --git a/commands/util-public/report.js b/commands/util-public/report.js index f58bcd1f..921263ab 100644 --- a/commands/util-public/report.js +++ b/commands/util-public/report.js @@ -8,7 +8,7 @@ module.exports = class ReportCommand extends Command { constructor(client) { super(client, { name: 'report', - aliases: ['bug', 'report-bug', 'feedback', 'contact', 'suggest', 'suggestion', 'abuse', 'report-abuse'], + aliases: ['contact'], group: 'util-public', description: 'Reports something to the bot owner(s).', guarded: true, diff --git a/commands/util-public/suggest.js b/commands/util-public/suggest.js new file mode 100644 index 00000000..9d462949 --- /dev/null +++ b/commands/util-public/suggest.js @@ -0,0 +1,23 @@ +const Command = require('../../framework/Command'); + +module.exports = class SuggestCommand extends Command { + constructor(client) { + super(client, { + name: 'suggest', + aliases: ['suggestion'], + group: 'util-public', + description: 'Shortcut to suggest new features.', + guarded: true, + args: [ + { + key: 'message', + type: 'string' + } + ] + }); + } + + run(msg, { message }) { + return this.client.registry.commands.get('report').run(msg, { reason: 'suggestion', message }); + } +}; diff --git a/framework/Command.js b/framework/Command.js index 66a105d7..d6f2cd6c 100644 --- a/framework/Command.js +++ b/framework/Command.js @@ -19,6 +19,7 @@ module.exports = class Command { this.guildOnly = options.guildOnly || false; this.game = options.game || false; this.guarded = options.guarded || false; + this.hidden = options.hidden || false; this.unknown = options.unknown || false; this.throttling = options.throttling || { usages: 2, duration: 5 }; this.sendTyping = typeof options.sendTyping === 'undefined' ? true : Boolean(options.sendTyping); diff --git a/package.json b/package.json index 730bc561..6780b73d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "155.1.0", + "version": "155.2.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {