Fix drop command not replying to the user on image read failure
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ethan Lane 2024-01-20 15:43:13 +00:00
parent 486826470a
commit 67b15a5c7a

View file

@ -36,11 +36,11 @@ export default class Drop extends Command {
}
try {
await interaction.deferReply();
const image = readFileSync(path.join(process.env.DATA_DIR!, "cards", randomCard.card.path));
const imageFileName = randomCard.card.path.split("/").pop()!;
await interaction.deferReply();
const attachment = new AttachmentBuilder(image, { name: imageFileName });
const inventory = await Inventory.FetchOneByCardNumberAndUserId(interaction.user.id, randomCard.card.id);