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 });