Фикс ошибок в reload

This commit is contained in:
JonnyBro 2022-01-04 12:59:50 +05:00
parent 0fe52f3a0e
commit f864369a74

View file

@ -20,12 +20,14 @@ class Reload extends Command {
async run(message, args, data) {
const command = args[0];
const cmd = this.client.commands.get(command) || this.client.commands.get(this.client.aliases.get(command));
if (!cmd) message.error("owner/reload:NOT_FOUND", { search: command });
if (!cmd) return message.error("owner/reload:NOT_FOUND", { search: command });
await this.client.unloadCommand(cmd.conf.location, cmd.help.name);
await this.client.loadCommand(cmd.conf.location, cmd.help.name);
i18next.reloadResources(data.guild.language);
const lang = data.guild.language || "ru-RU";
i18next.reloadResources(lang);
message.success("owner/reload:SUCCESS", {
command: cmd.help.name
});