From d9d1d02f129ac3fba05a13c71b2d19622ccc2879 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Fri, 31 Dec 2021 11:44:43 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20getNoun=20=D0=B2=20extendors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Economy/slots.js | 8 ++++---- helpers/extenders.js | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/commands/Economy/slots.js b/commands/Economy/slots.js index 1ab7dc2c..221215c7 100644 --- a/commands/Economy/slots.js +++ b/commands/Economy/slots.js @@ -34,7 +34,7 @@ class Slots extends Command { let amount = args[0]; if (!amount || isNaN(amount) || amount < 1) amount = 50; if (amount > data.memberData.money) return message.error("economy/slots:NOT_ENOUGH", { - money: `${amount} ${this.client.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` + money: `${amount} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` }); amount = Math.round(amount); @@ -78,8 +78,8 @@ class Slots extends Command { tmsg.edit(msg); const credits = getCredits(amount, true); message.channel.send("**!! ДЖЕКПОТ !!**\n" + message.translate("economy/slots:VICTORY", { - money: `${amount} ${this.client.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, - won: `${credits} ${this.client.getNoun(credits, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, + money: `${amount} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, + won: `${credits} ${message.getNoun(credits, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, username: message.author.username })); const toAdd = credits - amount; @@ -133,7 +133,7 @@ class Slots extends Command { msg += "| : : : **" + (message.translate("common:DEFEAT").toUpperCase()) + "** : : : |"; message.channel.send(message.translate("economy/slots:DEFEAT", { - money: `${amount} ${this.client.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, + money: `${amount} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, username: message.author.username })); data.memberData.money = data.memberData.money - amount; diff --git a/helpers/extenders.js b/helpers/extenders.js index a594e72b..1495706f 100644 --- a/helpers/extenders.js +++ b/helpers/extenders.js @@ -48,6 +48,10 @@ Message.prototype.convertTime = function (time, type, noPrefix) { return this.client.convertTime(time, type, noPrefix, (this.guild && this.guild.data) ? this.guild.data.language : null); }; +Message.prototype.getNoun = function(number, one, two, five) { + return this.client.getNoun(number, one, two, five); +}; + MessageEmbed.prototype.errorColor = function () { this.setColor("#FF0000");