mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 14:44:58 +05:00
Добавить getNoun в extendors
This commit is contained in:
parent
d6bdfdfb7f
commit
d9d1d02f12
2 changed files with 8 additions and 4 deletions
|
@ -34,7 +34,7 @@ class Slots extends Command {
|
||||||
let amount = args[0];
|
let amount = args[0];
|
||||||
if (!amount || isNaN(amount) || amount < 1) amount = 50;
|
if (!amount || isNaN(amount) || amount < 1) amount = 50;
|
||||||
if (amount > data.memberData.money) return message.error("economy/slots:NOT_ENOUGH", {
|
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);
|
amount = Math.round(amount);
|
||||||
|
@ -78,8 +78,8 @@ class Slots extends Command {
|
||||||
tmsg.edit(msg);
|
tmsg.edit(msg);
|
||||||
const credits = getCredits(amount, true);
|
const credits = getCredits(amount, true);
|
||||||
message.channel.send("**!! ДЖЕКПОТ !!**\n" + message.translate("economy/slots:VICTORY", {
|
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"))}`,
|
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} ${this.client.getNoun(credits, 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
|
username: message.author.username
|
||||||
}));
|
}));
|
||||||
const toAdd = credits - amount;
|
const toAdd = credits - amount;
|
||||||
|
@ -133,7 +133,7 @@ class Slots extends Command {
|
||||||
|
|
||||||
msg += "| : : : **" + (message.translate("common:DEFEAT").toUpperCase()) + "** : : : |";
|
msg += "| : : : **" + (message.translate("common:DEFEAT").toUpperCase()) + "** : : : |";
|
||||||
message.channel.send(message.translate("economy/slots:DEFEAT", {
|
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
|
username: message.author.username
|
||||||
}));
|
}));
|
||||||
data.memberData.money = data.memberData.money - amount;
|
data.memberData.money = data.memberData.money - amount;
|
||||||
|
|
|
@ -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);
|
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 () {
|
MessageEmbed.prototype.errorColor = function () {
|
||||||
this.setColor("#FF0000");
|
this.setColor("#FF0000");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue