Compare commits
2 commits
2ddb170b48
...
0029e4a456
Author | SHA1 | Date | |
---|---|---|---|
0029e4a456 | |||
7a72be4e64 |
5 changed files with 31 additions and 46 deletions
2
.dev.env
2
.dev.env
|
@ -7,7 +7,7 @@
|
|||
# any secret values.
|
||||
|
||||
BOT_TOKEN=
|
||||
BOT_VER=0.3.0 DEV
|
||||
BOT_VER=0.3.1
|
||||
BOT_AUTHOR=Vylpes
|
||||
BOT_OWNERID=147392775707426816
|
||||
BOT_CLIENTID=682942374040961060
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# any secret values.
|
||||
|
||||
BOT_TOKEN=
|
||||
BOT_VER=0.3.0
|
||||
BOT_VER=0.3.1
|
||||
BOT_AUTHOR=Vylpes
|
||||
BOT_OWNERID=147392775707426816
|
||||
BOT_CLIENTID=1093810443589529631
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# any secret values.
|
||||
|
||||
BOT_TOKEN=
|
||||
BOT_VER=0.3.0 BETA
|
||||
BOT_VER=0.3.1
|
||||
BOT_AUTHOR=Vylpes
|
||||
BOT_OWNERID=147392775707426816
|
||||
BOT_CLIENTID=1147976642942214235
|
||||
|
|
|
@ -27,15 +27,11 @@ export default class Reroll extends ButtonEvent {
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
let image: Buffer;
|
||||
const imageFileName = randomCard.card.path.split("/").pop()!;
|
||||
|
||||
try {
|
||||
image = readFileSync(path.join(process.cwd(), 'cards', randomCard.card.path));
|
||||
} catch {
|
||||
await interaction.reply(`Unable to fetch image for card ${randomCard.card.id}`);
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply();
|
||||
|
||||
|
@ -50,22 +46,18 @@ export default class Reroll extends ButtonEvent {
|
|||
|
||||
const row = CardDropHelperMetadata.GenerateDropButtons(randomCard, claimId, interaction.user.id);
|
||||
|
||||
try {
|
||||
await interaction.editReply({
|
||||
embeds: [ embed ],
|
||||
files: [ attachment ],
|
||||
components: [ row ],
|
||||
});
|
||||
|
||||
CoreClient.ClaimId = claimId;
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
if (e instanceof DiscordAPIError) {
|
||||
await interaction.editReply(`Unable to send next drop. Please try again, and report this if it keeps happening. Code: ${e.code}`);
|
||||
} else {
|
||||
await interaction.editReply(`Unable to send next drop. Please try again, and report this if it keeps happening. Code: UNKNOWN`);
|
||||
await interaction.editReply(`Unable to send next drop. Please try again, and report this if it keeps happening. (${randomCard.card.id})`);
|
||||
}
|
||||
}
|
||||
|
||||
CoreClient.ClaimId = claimId;
|
||||
}
|
||||
}
|
|
@ -35,15 +35,11 @@ export default class Drop extends Command {
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
let image: Buffer;
|
||||
const imageFileName = randomCard.card.path.split("/").pop()!;
|
||||
|
||||
try {
|
||||
image = readFileSync(path.join(process.cwd(), 'cards', randomCard.card.path));
|
||||
} catch {
|
||||
await interaction.reply(`Unable to fetch image for card ${randomCard.card.id}`);
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply();
|
||||
|
||||
|
@ -58,22 +54,19 @@ export default class Drop extends Command {
|
|||
|
||||
const row = CardDropHelperMetadata.GenerateDropButtons(randomCard, claimId, interaction.user.id);
|
||||
|
||||
try {
|
||||
await interaction.editReply({
|
||||
embeds: [ embed ],
|
||||
files: [ attachment ],
|
||||
components: [ row ],
|
||||
});
|
||||
|
||||
CoreClient.ClaimId = claimId;
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
if (e instanceof DiscordAPIError) {
|
||||
await interaction.editReply(`Unable to send next drop. Please try again, and report this if it keeps happening. Code: ${e.code}`);
|
||||
} else {
|
||||
await interaction.editReply(`Unable to send next drop. Please try again, and report this if it keeps happening. Code: UNKNOWN`);
|
||||
}
|
||||
await interaction.editReply(`Unable to send next drop. Please try again, and report this if it keeps happening. (${randomCard.card.id})`);
|
||||
}
|
||||
|
||||
CoreClient.ClaimId = claimId;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue