mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
30 lines
747 B
JavaScript
30 lines
747 B
JavaScript
const Command = require('../../framework/Command');
|
|
|
|
module.exports = class EnableCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'enable',
|
|
aliases: ['enable-command', 'enable-cmd'],
|
|
group: 'util',
|
|
memberName: 'enable',
|
|
description: 'Enables a command.',
|
|
details: 'Only the bot owner(s) may use this command.',
|
|
ownerOnly: true,
|
|
guarded: true,
|
|
args: [
|
|
{
|
|
key: 'command',
|
|
type: 'command'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
async run(msg, { command }) {
|
|
if (command._enabled) return msg.say(`The \`${command.name}\` command is already enabled.`);
|
|
command.enable();
|
|
await this.client.redis.db.hdel('disabled', command.name);
|
|
return msg.say(`Enabled the \`${command.name}\` command.`);
|
|
}
|
|
};
|