diff --git a/src/buttonEvents/Claim.ts b/src/buttonEvents/Claim.ts index dd9ef5d..a9f8c86 100644 --- a/src/buttonEvents/Claim.ts +++ b/src/buttonEvents/Claim.ts @@ -13,15 +13,17 @@ export default class Claim extends ButtonEvent { const droppedBy = interaction.customId.split(" ")[3]; const userId = interaction.user.id; + await interaction.deferReply(); + const claimed = await eClaim.FetchOneByClaimId(claimId); if (claimed) { - await interaction.reply("This card has already been claimed"); + await interaction.editReply("This card has already been claimed"); return; } if (claimId == CoreClient.ClaimId && userId != droppedBy) { - await interaction.reply("The latest dropped card can only be claimed by the user who dropped it"); + await interaction.editReply("The latest dropped card can only be claimed by the user who dropped it"); return; } @@ -40,6 +42,6 @@ export default class Claim extends ButtonEvent { await claim.Save(eClaim, claim); - await interaction.reply(`Card claimed by ${interaction.user}`); + await interaction.editReply(`Card claimed by ${interaction.user}`); } } \ No newline at end of file diff --git a/src/buttonEvents/Reroll.ts b/src/buttonEvents/Reroll.ts index e0d0a0b..a265bcb 100644 --- a/src/buttonEvents/Reroll.ts +++ b/src/buttonEvents/Reroll.ts @@ -27,9 +27,9 @@ export default class Reroll extends ButtonEvent { return; } - try { - await interaction.deferReply(); + await interaction.deferReply(); + try { const image = readFileSync(path.join(process.env.DATA_DIR!, "cards", randomCard.card.path)); const imageFileName = randomCard.card.path.split("/").pop()!; diff --git a/src/commands/drop.ts b/src/commands/drop.ts index b1c3f9f..e671e76 100644 --- a/src/commands/drop.ts +++ b/src/commands/drop.ts @@ -35,9 +35,9 @@ export default class Drop extends Command { return; } - try { - await interaction.deferReply(); + await interaction.deferReply(); + try { const image = readFileSync(path.join(process.env.DATA_DIR!, "cards", randomCard.card.path)); const imageFileName = randomCard.card.path.split("/").pop()!;