Merge branch 'main' into develop
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
38ac26b793
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "card-drop",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "card-drop",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@discordjs/rest": "^2.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "card-drop",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"main": "./dist/bot.js",
|
||||
"typings": "./dist",
|
||||
"scripts": {
|
||||
|
|
|
@ -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}`);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -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()!;
|
||||
|
||||
|
|
Loading…
Reference in a new issue