mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
34 lines
813 B
JavaScript
34 lines
813 B
JavaScript
const Command = require('../../framework/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.',
|
|
details: 'Only the bot owner(s) may use this command.',
|
|
guarded: true,
|
|
ownerOnly: true,
|
|
args: [
|
|
{
|
|
key: 'command',
|
|
label: 'command',
|
|
type: 'command'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { command }) {
|
|
this.client.exportCommandLeaderboard();
|
|
this.client.exportLastRun();
|
|
command.reload();
|
|
this.client.importCommandLeaderboard();
|
|
this.client.importLastRun();
|
|
this.client.registry.commands.get('cloc').cache = null;
|
|
return msg.say(`Reloaded the \`${command.name}\` command.`);
|
|
}
|
|
};
|