mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 06:34:58 +05:00
Фикс команд в ЛС
This commit is contained in:
parent
85665f09e0
commit
f6370e044a
1 changed files with 2 additions and 2 deletions
|
@ -1,14 +1,14 @@
|
|||
const { Message, BaseInteraction } = require("discord.js");
|
||||
|
||||
BaseInteraction.prototype.translate = function (key, args) {
|
||||
const language = this.client.translations.get(this.guild.data ? this.guild.data.language ? this.guild.data.language : "ru-RU" : "ru-RU");
|
||||
const language = this.client.translations.get(this.guild ? (this.guild.data ? this.guild.data.language : "ru-RU") : "ru-RU");
|
||||
if (!language) throw "Interaction: Invalid language set in data.";
|
||||
|
||||
return language(key, args);
|
||||
};
|
||||
|
||||
BaseInteraction.prototype.replyT = function (key, args, options = {}) {
|
||||
let string = this.translate(key, args, this.guild.data ? this.guild.data.language ? this.guild.data.language : "ru-RU" : "ru-RU");
|
||||
let string = this.translate(key, args);
|
||||
if (options.prefixEmoji) string = `${this.client.customEmojis[options.prefixEmoji]} | ${string}`;
|
||||
|
||||
if (options.edit) return this.editReply({ content: string, ephemeral: options.ephemeral || false });
|
||||
|
|
Loading…
Reference in a new issue