Files
xiao/commands/util/reload.js
T
2021-02-01 21:51:00 -05:00

34 lines
812 B
JavaScript

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.',
details: 'Only the bot owner(s) may use this command.',
guarded: true,
ownerOnly: true,
args: [
{
key: 'command',
label: 'command',
prompt: 'Which command would you like to reload?',
type: 'command'
}
]
});
}
run(msg, { command }) {
this.client.exportCommandLeaderboard();
this.client.exportLastRun();
command.reload();
this.client.importCommandLeaderboard();
this.client.importLastRun();
return msg.say(`Reloaded the \`${command.name}\` command.`);
}
};