Create simple inventory list #120

Merged
Vylpes merged 10 commits from feature/97-simple-inventory-list into develop 2023-12-22 14:41:14 +00:00
Showing only changes of commit b667f1ffb9 - Show all commits

View file

@ -20,7 +20,7 @@ interface InventoryPageCards {
} }
export default class InventoryHelper { export default class InventoryHelper {
public static async GenerateInventoryPage(userid: string, page: number): Promise<{ embed: EmbedBuilder, row: ActionRowBuilder<ButtonBuilder> }> { public static async GenerateInventoryPage(username: string, userid: string, page: number): Promise<{ embed: EmbedBuilder, row: ActionRowBuilder<ButtonBuilder> }> {
const cardsPerPage = 9; const cardsPerPage = 9;
const inventory = await Inventory.FetchAllByUserId(userid); const inventory = await Inventory.FetchAllByUserId(userid);
@ -76,9 +76,9 @@ export default class InventoryHelper {
} }
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle(`${currentPage.name} (${currentPage.seriesSubpage + 1})`) .setTitle(username)
.setDescription(currentPage.cards.map(x => `[${x.id}] ${x.name} (${CardRarityToString(x.type)}) x${x.quantity}`).join('\n')) .setDescription(currentPage.cards.map(x => `[${x.id}] ${x.name} (${CardRarityToString(x.type)}) x${x.quantity}`).join('\n'))
.setFooter({ text: `Page ${page} of ${pages.length}` }) .setFooter({ text: `${currentPage.name} (${currentPage.seriesSubpage + 1}) · Page ${page} of ${pages.length}` })
.setColor(EmbedColours.Ok); .setColor(EmbedColours.Ok);
const row = new ActionRowBuilder<ButtonBuilder>() const row = new ActionRowBuilder<ButtonBuilder>()