mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 22:55:00 +05:00
Фикс ошибок в reload
This commit is contained in:
parent
0fe52f3a0e
commit
f864369a74
1 changed files with 4 additions and 2 deletions
|
@ -20,12 +20,14 @@ class Reload extends Command {
|
||||||
async run(message, args, data) {
|
async run(message, args, data) {
|
||||||
const command = args[0];
|
const command = args[0];
|
||||||
const cmd = this.client.commands.get(command) || this.client.commands.get(this.client.aliases.get(command));
|
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.unloadCommand(cmd.conf.location, cmd.help.name);
|
||||||
await this.client.loadCommand(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", {
|
message.success("owner/reload:SUCCESS", {
|
||||||
command: cmd.help.name
|
command: cmd.help.name
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue