Add card count onto the series list command #293
1 changed files with 4 additions and 3 deletions
|
@ -20,6 +20,7 @@ export default class SeriesHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
const totalPages = Math.ceil(series.cards.length / itemsPerPage);
|
const totalPages = Math.ceil(series.cards.length / itemsPerPage);
|
||||||
|
const totalCards = series.cards.length;
|
||||||
|
|
||||||
if (page > totalPages) {
|
if (page > totalPages) {
|
||||||
AppLogger.LogVerbose("Helpers/SeriesHelper", `Trying to find page greater than what exists for this series. Page: ${page} but there are only ${totalPages} pages`);
|
AppLogger.LogVerbose("Helpers/SeriesHelper", `Trying to find page greater than what exists for this series. Page: ${page} but there are only ${totalPages} pages`);
|
||||||
|
@ -36,7 +37,7 @@ export default class SeriesHelper {
|
||||||
.setTitle(series.name)
|
.setTitle(series.name)
|
||||||
.setColor(EmbedColours.Ok)
|
.setColor(EmbedColours.Ok)
|
||||||
.setDescription(description)
|
.setDescription(description)
|
||||||
.setFooter({ text: `${series.id} · ${series.cards.length} cards · Page ${page + 1} of ${totalPages}` });
|
.setFooter({ text: `${series.id} · ${totalCards} cards · Page ${page + 1} of ${totalPages}` });
|
||||||
|
|
||||||
const row = new ActionRowBuilder<ButtonBuilder>()
|
const row = new ActionRowBuilder<ButtonBuilder>()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
|
@ -72,7 +73,7 @@ export default class SeriesHelper {
|
||||||
const seriesOnPage = series.splice(page * itemsPerPage, itemsPerPage);
|
const seriesOnPage = series.splice(page * itemsPerPage, itemsPerPage);
|
||||||
|
|
||||||
const description = seriesOnPage
|
const description = seriesOnPage
|
||||||
.map(x => `[${x.id}] ${x.name}`)
|
.map(x => `[${x.id}] ${x.name} (x${x.cards.length})`)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
|
|
Loading…
Reference in a new issue