Put user's name in the embed

This commit is contained in:
Ethan Lane 2023-12-20 18:30:32 +00:00
parent 3c3381847b
commit b667f1ffb9

View file

@ -20,7 +20,7 @@ interface InventoryPageCards {
}
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 inventory = await Inventory.FetchAllByUserId(userid);
@ -76,9 +76,9 @@ export default class InventoryHelper {
}
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'))
.setFooter({ text: `Page ${page} of ${pages.length}` })
.setFooter({ text: `${currentPage.name} (${currentPage.seriesSubpage + 1}) · Page ${page} of ${pages.length}` })
.setColor(EmbedColours.Ok);
const row = new ActionRowBuilder<ButtonBuilder>()