Фиксы

This commit is contained in:
JonnyBro 2022-01-13 23:09:43 +05:00
parent 24a8e1038e
commit 3fbac5b6a6
6 changed files with 30 additions and 26 deletions

View file

@ -33,7 +33,7 @@ class Slots extends Command {
// Gets the amount provided
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} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` });
if (amount > data.memberData.money) return message.error("economy/slots:NOT_ENOUGH", { 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);
@ -77,8 +77,8 @@ class Slots extends Command {
const credits = getCredits(amount, true);
message.channel.send({
content: "**!! ДЖЕКПОТ !!**\n" + message.translate("economy/slots:VICTORY", {
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"))}`,
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
})
});
@ -119,8 +119,8 @@ class Slots extends Command {
const credits = getCredits(amount, false);
message.channel.send({
content: message.translate("economy/slots:VICTORY", {
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"))}`,
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
})
});
@ -157,7 +157,7 @@ class Slots extends Command {
msg += "| : : : **" + (message.translate("common:DEFEAT").toUpperCase()) + "** : : : |";
message.channel.send({
content: message.translate("economy/slots:DEFEAT", {
money: `${amount} ${message.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
})
});

View file

@ -14,6 +14,8 @@ router.get("/:serverID", CheckAuth, async (req, res) => {
});
}
const memberData = await req.client.findOrCreateMember({ id: req.userInfos.id, guildID: guild.id });
// Fetch guild informations
const membersData = await req.client.membersData.find({
guildID: guild.id
@ -43,6 +45,7 @@ router.get("/:serverID", CheckAuth, async (req, res) => {
res.render("stats/guild", {
user: req.userInfos,
stats,
memberData: memberData,
bot: req.client,
guildID: guild.id,
translate: req.translate,

View file

@ -64,25 +64,6 @@
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-refresh"></i></span>
<div class="info-box-content">
<span class="info-box-text"><%= translate("dashboard:COOLDOWNS") %></span>
<span class="info-box-number"><%= translate("dashboard:REP") %>: <%= user.cooldowns.rep > Date.now() ? convertTime(user.cooldowns.rep) : translate("dashboard:CAN_USE") %></span>
<% for (const c in memberData.cooldowns) { %>
<% if (c !== "rob") { %>
<span class="info-box-number"><%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] > Date.now() ? convertTime(memberData.cooldowns[c]) : translate("dashboard:CAN_USE") %></span>
<% } else { %>
<span class="info-box-number"><%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] > Date.now() ? convertTime(memberData.cooldowns[c]) : translate("dashboard:NO_DEFENCE") %></span>
<% }; %>
<% }; %>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">

View file

@ -39,6 +39,7 @@
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">

View file

@ -55,6 +55,25 @@
</div>
</div>
<!-- /.nav-tabs-custom -->
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-refresh"></i></span>
<div class="info-box-content">
<span class="info-box-text"><%= translate("dashboard:COOLDOWNS") %></span>
<span class="info-box-number"><%= translate("dashboard:REP") %>: <%= user.cooldowns.rep > Date.now() ? convertTime(user.cooldowns.rep) : translate("dashboard:CAN_USE") %></span>
<% for (const c in memberData.cooldowns) { %>
<% if (c !== "rob") { %>
<span class="info-box-number"><%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] > Date.now() ? convertTime(memberData.cooldowns[c]) : translate("dashboard:CAN_USE") %></span>
<% } else { %>
<span class="info-box-number"><%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] > Date.now() ? convertTime(memberData.cooldowns[c]) : translate("dashboard:NO_DEFENCE") %></span>
<% }; %>
<% }; %>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</section>
<!-- /.col -->
<div class="col-md-4">

View file

@ -4,5 +4,5 @@
"EXAMPLES": "{{prefix}}slots\n{{prefix}}slots 100",
"DEFEAT": "**{{username}}** поставил {{money}} и всё проиграл.",
"VICTORY": "**{{username}}** поставил {{money}} и выиграл {{won}}!",
"NOT_ENOUGH": "У вас должно быть хотя бы **{{money}}**."
"NOT_ENOUGH": "У вас нет {{money}}."
}