Add drop rarity force logic to reroll
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ethan Lane 2023-09-05 19:42:07 +01:00
parent 20461dde6d
commit 97dc81df9a

View file

@ -10,7 +10,11 @@ export default class Reroll extends ButtonEvent {
public override async execute(interaction: ButtonInteraction) {
if (!interaction.guild || !interaction.guildId) return;
const randomCard = await CardDropHelper.GetRandomCard();
let randomCard = await CardDropHelper.GetRandomCard();
if (process.env.DROP_RARITY && Number(process.env.DROP_RARITY) > 0) {
randomCard = await CardDropHelper.GetRandomCardByRarity(Number(process.env.DROP_RARITY));
}
const image = readFileSync(randomCard.Path);