From 2551616886c399bb71b41eb610b16b31cdf4df90 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Wed, 9 Nov 2022 21:48:41 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helpers/extenders.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helpers/extenders.js b/helpers/extenders.js index a8f5dfd9..9e43b7b6 100644 --- a/helpers/extenders.js +++ b/helpers/extenders.js @@ -1,13 +1,13 @@ -const { Message, CommandInteraction } = require("discord.js"); +const { Message, BaseInteraction } = require("discord.js"); -CommandInteraction.prototype.translate = function (key, args) { +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"); if (!language) throw "Interaction: Invalid language set in data."; return language(key, args); }; -CommandInteraction.prototype.replyT = function (key, args, options = {}) { +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"); if (options.prefixEmoji) string = `${this.client.customEmojis[options.prefixEmoji]} | ${string}`; @@ -15,13 +15,13 @@ CommandInteraction.prototype.replyT = function (key, args, options = {}) { else return this.reply({ content: string, ephemeral: options.ephemeral || false }); }; -CommandInteraction.prototype.error = function (key, args, options = {}) { +BaseInteraction.prototype.error = function (key, args, options = {}) { options.prefixEmoji = "error"; return this.replyT(key, args, options); }; -CommandInteraction.prototype.success = function (key, args, options = {}) { +BaseInteraction.prototype.success = function (key, args, options = {}) { options.prefixEmoji = "success"; return this.replyT(key, args, options);