Add enable and disable commands

This commit is contained in:
Dragon Fire
2024-03-30 01:02:07 -04:00
parent cc4f592695
commit 4d88d529df
7 changed files with 63 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
const Command = require('../../framework/Command');
module.exports = class DisableCommand extends Command {
constructor(client) {
super(client, {
name: 'disable',
aliases: ['disable-command', 'disable-cmd'],
group: 'util',
memberName: 'disable',
description: 'Disables a command.',
details: 'Only the bot owner(s) may use this command.',
ownerOnly: true,
guarded: true,
args: [
{
key: 'command',
type: 'command'
}
]
});
}
run(msg, { command }) {
if (!command._enabled) return msg.say(`The \`${command.name}\` command is already disabled.`);
if (command.guarded) return msg.say(`The \`${command.name}\` command cannot be disabled.`);
command.disable();
return msg.say(`Disabled the \`${command.name}\` command.`);
}
};