Skip to content

Commit

Permalink
Limit balance printing in blackjack
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMonDon committed Jul 21, 2024
1 parent 6dd6a33 commit 89d32ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions commands/Economy/blackjack.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,23 @@ class BlackJack extends Command {
const newAmount = cash + amount;
await db.set(`servers.${msg.guild.id}.users.${msg.member.id}.economy.cash`, newAmount.toString());

return cardEmbed(`Result: You win ${currencySymbol}${amount.toLocaleString()}`);
let csAmount = currencySymbol + newAmount.toLocaleString();
csAmount = csAmount.length > 1024 ? csAmount.slice(0, 1021) + '...' : csAmount;
return cardEmbed(`Result: You win ${csAmount}`);
} else if (blackjack) {
const newAmount = cash + amount;
await db.set(`servers.${msg.guild.id}.users.${msg.member.id}.economy.cash`, newAmount.toString());

return cardEmbed(`Result: BlackJack, you win ${currencySymbol}${amount.toLocaleString()}`);
let csAmount = currencySymbol + newAmount.toLocaleString();
csAmount = csAmount.length > 1024 ? csAmount.slice(0, 1021) + '...' : csAmount;
return cardEmbed(`Result: BlackJack, you win ${csAmount}`);
} else if (bust) {
const newAmount = cash - amount;
await db.set(`servers.${msg.guild.id}.users.${msg.member.id}.economy.cash`, newAmount.toString());

return cardEmbed(`Result: Bust, you lose ${currencySymbol}${amount.toLocaleString()}`);
let csAmount = currencySymbol + newAmount.toLocaleString();
csAmount = csAmount.length > 1024 ? csAmount.slice(0, 1021) + '...' : csAmount;
return cardEmbed(`Result: Bust, you lose ${csAmount}`);
} else if (push) {
return cardEmbed('Result: Push, money back');
}
Expand Down

0 comments on commit 89d32ee

Please sign in to comment.