From 27e32046fd29b2825af52a00efde7d81a42f407b Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Sat, 9 Dec 2023 17:06:55 +0000 Subject: [PATCH] Fix dropnumber command --- src/commands/stage/dropnumber.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/commands/stage/dropnumber.ts b/src/commands/stage/dropnumber.ts index d311f33..a7de021 100644 --- a/src/commands/stage/dropnumber.ts +++ b/src/commands/stage/dropnumber.ts @@ -31,20 +31,18 @@ export default class Dropnumber extends Command { return; } - const series = CoreClient.Cards.find(x => x.cards.find(y => y.id == cardNumber.toString())); - - if (!series) { - await interaction.reply('Card not found'); - return; - } - - const card = series.cards.find(x => x.id == cardNumber.toString()); + const card = CoreClient.Cards + .flatMap(x => x.cards) + .find(x => x.id == cardNumber.value); if (!card) { await interaction.reply('Card not found'); return; } + const series = CoreClient.Cards + .find(x => x.cards.includes(card))!; + let image: Buffer; const imageFileName = card.path.split("/").pop()!;