Reloading all is a bit slow

This commit is contained in:
Dragon Fire
2024-05-21 21:10:30 -04:00
parent bd02c6b1c4
commit 8cda43d503
+2 -10
View File
@@ -14,8 +14,7 @@ module.exports = class ReloadCommand extends Command {
{ {
key: 'command', key: 'command',
label: 'command', label: 'command',
type: 'command', type: 'command'
default: ''
} }
] ]
}); });
@@ -24,17 +23,10 @@ module.exports = class ReloadCommand extends Command {
run(msg, { command }) { run(msg, { command }) {
this.client.exportCommandLeaderboard(); this.client.exportCommandLeaderboard();
this.client.exportLastRun(); this.client.exportLastRun();
if (command) { command.reload();
command.reload();
} else {
for (const cmd of this.client.registry.commands.values()) {
cmd.reload();
}
}
this.client.importCommandLeaderboard(); this.client.importCommandLeaderboard();
this.client.importLastRun(); this.client.importLastRun();
this.client.registry.commands.get('cloc').cache = null; this.client.registry.commands.get('cloc').cache = null;
if (!command) return msg.say('Reloaded all commands.');
return msg.say(`Reloaded the \`${command.name}\` command.`); return msg.say(`Reloaded the \`${command.name}\` command.`);
} }
}; };