Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
c4e345cc46 | |||
659906e562 | |||
1796f2519e |
2 changed files with 49 additions and 39 deletions
|
@ -60,6 +60,7 @@ export default class Series extends Command {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
const embed = await SeriesHelper.GenerateSeriesViewPage(series.id, 0, interaction.user.id);
|
const embed = await SeriesHelper.GenerateSeriesViewPage(series.id, 0, interaction.user.id);
|
||||||
|
|
||||||
await interaction.followUp({
|
await interaction.followUp({
|
||||||
|
@ -67,6 +68,10 @@ export default class Series extends Command {
|
||||||
components: [ embed!.row ],
|
components: [ embed!.row ],
|
||||||
files: [ embed!.image ],
|
files: [ embed!.image ],
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
await interaction.followUp("An error has occured generating the series grid.");
|
||||||
|
AppLogger.CatchError("Series", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async ListSeries(interaction: CommandInteraction) {
|
private async ListSeries(interaction: CommandInteraction) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ export default class ImageHelper {
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
|
|
||||||
for (let i = 0; i < cards.length; i++) {
|
for (let i = 0; i < cards.length; i++) {
|
||||||
|
try {
|
||||||
const card = cards[i];
|
const card = cards[i];
|
||||||
|
|
||||||
const filePath = path.join(process.env.DATA_DIR!, "cards", card.path);
|
const filePath = path.join(process.env.DATA_DIR!, "cards", card.path);
|
||||||
|
@ -67,6 +68,10 @@ export default class ImageHelper {
|
||||||
|
|
||||||
ctx.drawImage(image, imageX, imageY);
|
ctx.drawImage(image, imageX, imageY);
|
||||||
}
|
}
|
||||||
|
catch (e) {
|
||||||
|
AppLogger.CatchError("ImageHelper", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return canvas.toBuffer();
|
return canvas.toBuffer();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue