Compare commits

..

No commits in common. "6c005940851d482f1a3f9683e0dedcc09e238efd" and "10806bd0f14105b3bbd0710c15fd040deb4ea83b" have entirely different histories.

8 changed files with 13 additions and 15 deletions

View file

@ -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

View file

@ -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

View file

@ -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

4
package-lock.json generated
View file

@ -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",

View file

@ -1,6 +1,6 @@
{
"name": "card-drop",
"version": "0.4.2",
"version": "0.4.1",
"main": "./dist/bot.js",
"typings": "./dist",
"scripts": {

View file

@ -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}`);
}
}

View file

@ -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);

View file

@ -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()!;