From f6370e044ade9282dd0dd00d4a92fad9d8230dd8 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Mon, 14 Nov 2022 17:57:20 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=B4=20=D0=B2=20=D0=9B=D0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helpers/extenders.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/extenders.js b/helpers/extenders.js index 9e43b7b6..8b40b2cb 100644 --- a/helpers/extenders.js +++ b/helpers/extenders.js @@ -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 });