Add ability to force a card
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ethan Lane 2023-09-05 20:45:33 +01:00
parent 476b9ad5f9
commit 5ec79ee67c
6 changed files with 31 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import { CardRarityToColour, CardRarityToString } from "../constants/CardRarity"
import { readFileSync } from "fs";
import { CoreClient } from "../client/client";
import { v4 } from "uuid";
import Card from "../database/entities/card/Card";
export default class Drop extends Command {
constructor() {
@ -20,6 +21,15 @@ export default class Drop extends Command {
if (process.env.DROP_RARITY && Number(process.env.DROP_RARITY) > 0) {
randomCard = await CardDropHelper.GetRandomCardByRarity(Number(process.env.DROP_RARITY));
} else if (process.env.DROP_CARD && process.env.DROP_CARD != '-1') {
let card = await Card.FetchOneByCardNumber(process.env.DROP_CARD, [ "Series" ]);
if (!card) {
await interaction.reply("Card not found");
return;
}
randomCard = card;
}
const image = readFileSync(randomCard.Path);