From 67b15a5c7a8311876d7be7ede09c5cf4acef5c90 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Sat, 20 Jan 2024 15:43:13 +0000 Subject: [PATCH] Fix drop command not replying to the user on image read failure --- src/commands/drop.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/drop.ts b/src/commands/drop.ts index 3e7101b..b1c3f9f 100644 --- a/src/commands/drop.ts +++ b/src/commands/drop.ts @@ -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);