diff --git a/.dev.env b/.dev.env index e90d90a..07dace6 100644 --- a/.dev.env +++ b/.dev.env @@ -7,7 +7,7 @@ # any secret values. BOT_TOKEN= -BOT_VER=0.4.2 +BOT_VER=0.4.1 BOT_AUTHOR=Vylpes BOT_OWNERID=147392775707426816 BOT_CLIENTID=682942374040961060 diff --git a/.prod.env b/.prod.env index 3dc2ddf..d1230b7 100644 --- a/.prod.env +++ b/.prod.env @@ -7,7 +7,7 @@ # any secret values. BOT_TOKEN= -BOT_VER=0.4.2 +BOT_VER=0.4.1 BOT_AUTHOR=Vylpes BOT_OWNERID=147392775707426816 BOT_CLIENTID=1093810443589529631 diff --git a/.stage.env b/.stage.env index acadb00..c8a3c2c 100644 --- a/.stage.env +++ b/.stage.env @@ -7,7 +7,7 @@ # any secret values. BOT_TOKEN= -BOT_VER=0.4.2 +BOT_VER=0.4.1 BOT_AUTHOR=Vylpes BOT_OWNERID=147392775707426816 BOT_CLIENTID=1147976642942214235 diff --git a/package-lock.json b/package-lock.json index c69214b..9352625 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "card-drop", - "version": "0.4.2", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "card-drop", - "version": "0.4.2", + "version": "0.4.1", "license": "MIT", "dependencies": { "@discordjs/rest": "^2.0.0", diff --git a/package.json b/package.json index f0194d2..0f8aaaf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "card-drop", - "version": "0.4.2", + "version": "0.4.1", "main": "./dist/bot.js", "typings": "./dist", "scripts": { diff --git a/src/buttonEvents/Claim.ts b/src/buttonEvents/Claim.ts index a9f8c86..dd9ef5d 100644 --- a/src/buttonEvents/Claim.ts +++ b/src/buttonEvents/Claim.ts @@ -13,17 +13,15 @@ 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.editReply("This card has already been claimed"); + await interaction.reply("This card has already been claimed"); return; } if (claimId == CoreClient.ClaimId && userId != droppedBy) { - await interaction.editReply("The latest dropped card can only be claimed by the user who dropped it"); + await interaction.reply("The latest dropped card can only be claimed by the user who dropped it"); return; } @@ -42,6 +40,6 @@ export default class Claim extends ButtonEvent { await claim.Save(eClaim, claim); - await interaction.editReply(`Card claimed by ${interaction.user}`); + await interaction.reply(`Card claimed by ${interaction.user}`); } } \ No newline at end of file diff --git a/src/buttonEvents/Reroll.ts b/src/buttonEvents/Reroll.ts index a265bcb..a647acd 100644 --- a/src/buttonEvents/Reroll.ts +++ b/src/buttonEvents/Reroll.ts @@ -27,12 +27,12 @@ export default class Reroll extends ButtonEvent { return; } - await interaction.deferReply(); - try { 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); diff --git a/src/commands/drop.ts b/src/commands/drop.ts index e671e76..b1c3f9f 100644 --- a/src/commands/drop.ts +++ b/src/commands/drop.ts @@ -35,9 +35,9 @@ export default class Drop extends Command { return; } - await interaction.deferReply(); - try { + await interaction.deferReply(); + const image = readFileSync(path.join(process.env.DATA_DIR!, "cards", randomCard.card.path)); const imageFileName = randomCard.card.path.split("/").pop()!;