mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add Reload Command
This commit is contained in:
@@ -260,7 +260,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 554
|
||||
Total: 555
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -290,6 +290,7 @@ Total: 554
|
||||
* **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)
|
||||
* **reload:** Reloads a command or command group. (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,31 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class ReloadCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'reload',
|
||||
aliases: ['reload-command', 'reload-cmd'],
|
||||
group: 'util',
|
||||
memberName: 'reload',
|
||||
description: 'Reloads a command or command group.',
|
||||
details: 'Only the bot owner(s) may use this command.',
|
||||
guarded: true,
|
||||
ownerOnly: true,
|
||||
args: [
|
||||
{
|
||||
key: 'cmdOrGrp',
|
||||
label: 'command/group',
|
||||
prompt: 'Which command or group would you like to reload?',
|
||||
type: 'command|group'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { cmdOrGrp }) {
|
||||
const isCmd = Boolean(cmdOrGrp.groupID);
|
||||
cmdOrGrp.reload();
|
||||
if (isCmd) return msg.say(`Reloaded the \`${cmdOrGrp.name}\` command.`);
|
||||
return msg.say(`Reloaded all of the commands in the \`${cmdOrGrp.name}\` group.`);
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.37.6",
|
||||
"version": "119.38.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user