Add dropdown to /inventory command for quick navigation #365
1 changed files with 10 additions and 10 deletions
|
@ -116,16 +116,16 @@ export default class InventoryHelper {
|
||||||
let pageNum = 0;
|
let pageNum = 0;
|
||||||
|
|
||||||
const row2 = new ActionRowBuilder<StringSelectMenuBuilder>()
|
const row2 = new ActionRowBuilder<StringSelectMenuBuilder>()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new StringSelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId("inventory")
|
.setCustomId("inventory")
|
||||||
.setPlaceholder(`${currentPage.name} (${currentPage.seriesSubpage + 1})`)
|
.setPlaceholder(`${currentPage.name} (${currentPage.seriesSubpage + 1})`)
|
||||||
.addOptions(...pages.map(x =>
|
.addOptions(...pages.map(x =>
|
||||||
new StringSelectMenuOptionBuilder()
|
new StringSelectMenuOptionBuilder()
|
||||||
.setLabel(`${x.name} (${x.seriesSubpage + 1})`.substring(0, 100))
|
.setLabel(`${x.name} (${x.seriesSubpage + 1})`.substring(0, 100))
|
||||||
.setDescription(`Page ${pageNum + 1}`)
|
.setDescription(`Page ${pageNum + 1}`)
|
||||||
.setDefault(currentPage.id == x.id)
|
.setDefault(currentPage.id == x.id)
|
||||||
.setValue(`${userid} ${pageNum++}`))));
|
.setValue(`${userid} ${pageNum++}`))));
|
||||||
|
|
||||||
const buffer = await ImageHelper.GenerateCardImageGrid(currentPage.cards.map(x => ({ id: x.id, path: x.path })));
|
const buffer = await ImageHelper.GenerateCardImageGrid(currentPage.cards.map(x => ({ id: x.id, path: x.path })));
|
||||||
const image = new AttachmentBuilder(buffer, { name: "page.png" });
|
const image = new AttachmentBuilder(buffer, { name: "page.png" });
|
||||||
|
|
Loading…
Reference in a new issue