Fix dropnumber command
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ethan Lane 2023-12-09 17:06:55 +00:00
parent be7a7c4ca4
commit 27e32046fd

View file

@ -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()!;