Compare commits

...

3 commits
v0.9.1 ... main

Author SHA1 Message Date
fc3c98f1bb v0.9.2
All checks were successful
Deploy To Production / build (push) Successful in 56s
Deploy To Production / deploy (push) Successful in 17s
2025-05-28 18:17:48 +01:00
c9f7c443cf Fix effects helper returning an error when the buttons are disabled (#454)
All checks were successful
Test / build (push) Successful in 45s
-This caused an issue with the updated embed after confirming to buy an effect it checking you had enough currency after taking the currency away

#453

Reviewed-on: #454
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2025-05-28 16:14:42 +01:00
434f162a01 Update unclaimed card filter to fallback to any card if all cards are claimed (#452)
All checks were successful
Test / build (push) Successful in 1m2s
#451

Reviewed-on: #452
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2025-05-28 16:07:38 +01:00
3 changed files with 6 additions and 7 deletions

View file

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

View file

@ -39,12 +39,11 @@ 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));
.filter(x => !claimedCards.find(y => y.CardNumber == x.id && y.Quantity > 0));
if (!allCards) {
AppLogger.LogError("CardDropHelperMetadata/GetRandomCardByRarityUnclaimed", `No cards found to randomise from, User Id: ${userId}, rarity: ${rarity}`);
return undefined;
if (!allCards || allCards.length == 0) {
// There is no card left unclaimed, fallback to any card
return GetCardsHelper.GetRandomCardByRarity(rarity);
};
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 (user.Currency < totalCost) {
if (!disabled && user.Currency < totalCost) {
return `You don't have enough currency to buy this! You have \`${user.Currency} Currency\` and need \`${totalCost} Currency\`!`;
}