Compare commits

..

No commits in common. "main" and "v0.9.1" have entirely different histories.
main ... v0.9.1

3 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,6 @@
{
"name": "card-drop",
"version": "0.9.2",
"version": "0.9.1",
"main": "./dist/bot.js",
"typings": "./dist",
"scripts": {

View file

@ -39,11 +39,12 @@ export default class GetUnclaimedCardsHelper {
const allCards = CoreClient.Cards
.flatMap(x => x.cards)
.filter(x => x.type == rarity)
.filter(x => !claimedCards.find(y => y.CardNumber == x.id && y.Quantity > 0));
.filter(x => !claimedCards.find(y => y.CardNumber == x.id));
if (!allCards || allCards.length == 0) {
// There is no card left unclaimed, fallback to any card
return GetCardsHelper.GetRandomCardByRarity(rarity);
if (!allCards) {
AppLogger.LogError("CardDropHelperMetadata/GetRandomCardByRarityUnclaimed", `No cards found to randomise from, User Id: ${userId}, rarity: ${rarity}`);
return undefined;
};
const randomCardIndex = Math.floor(Math.random() * allCards.length);

View file

@ -151,7 +151,7 @@ export default class EffectHelper {
AppLogger.LogInfo("EffectHelper", `Created initial user entity for : ${userId}`);
}
if (!disabled && user.Currency < totalCost) {
if (user.Currency < totalCost) {
return `You don't have enough currency to buy this! You have \`${user.Currency} Currency\` and need \`${totalCost} Currency\`!`;
}