all repos — stealth-developers @ d79754b8030e98a6a187e303ce27a12e7e6a04ea

feat: populate select menu opt's from `PROJECT_MAP`
willow hai@wlo.moe
Tue, 27 May 2025 23:04:03 +0100
commit

d79754b8030e98a6a187e303ce27a12e7e6a04ea

parent

450f718e0fd2967bc61c53f8d48227c222a93ade

1 files changed, 7 insertions(+), 11 deletions(-)

jump to
M src/interactions/commands/bug.tssrc/interactions/commands/bug.ts

@@ -333,20 +333,16 @@ async function buttonExecute(client: Client, interaction: ButtonInteraction) {

const [, action, bugId] = interaction.customId.split(":"); if (action === "new") { + const options = Object.entries(PROJECT_MAP).map(([key, project]) => + new StringSelectMenuOptionBuilder() + .setLabel(project.displayName) + .setValue(key), + ); + const selectMenu = new StringSelectMenuBuilder() .setCustomId("bug:project-select") .setPlaceholder("select a project") - .addOptions( - new StringSelectMenuOptionBuilder() - .setLabel("warfare tycoon") - .setValue("wft"), - new StringSelectMenuOptionBuilder() - .setLabel("ground war") - .setValue("gw"), - new StringSelectMenuOptionBuilder() - .setLabel("airsoft battles") - .setValue("ab"), - ); + .addOptions(...options); const row = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents( selectMenu,