Skip to content

StringSelectBuilder

StringSelectBuilder creates a string-based select menu component where users pick from a predefined list of text options.

import { StringSelectBuilder } from "lunibee";

All methods return this for chaining.

Sets the custom ID for this select menu.

select.setCustomId("color_picker");

Sets the hint text shown when nothing is selected (max 150 characters).

select.setPlaceholder("Choose a color…");

Sets the minimum number of values the user must select (default: 1).

select.setMinValues(1);

Sets the maximum number of values the user can select (default: 1, max: 25).

select.setMaxValues(3);

Disables the select menu.

select.setDisabled(true);

Adds one or more options (max 25 total). Each option has:

Field Type Required Description
label string Visible text (max 100 chars).
value string Submitted value (max 100 chars).
description string Subtitle text (max 100 chars).
emoji string | object Emoji to display.
default boolean Pre-selected state.
select.addOptions(
{ label: "Red", value: "red", emoji: "🔴", description: "Bold and passionate" },
{ label: "Blue", value: "blue", emoji: "🔵", description: "Calm and collected" },
{ label: "Green", value: "green", emoji: "🟢", description: "Fresh and energetic" },
);

Replaces all options with a new set.

Serializes to a raw Discord API-compatible component object.

Role selector

import { ActionRowBuilder, StringSelectBuilder } from "lunibee";
const row = new ActionRowBuilder<StringSelectBuilder>().addComponents(
new StringSelectBuilder()
.setCustomId("role_select")
.setPlaceholder("Pick up to 2 roles")
.setMinValues(1)
.setMaxValues(2)
.addOptions(
{ label: "Announcements", value: "announcements", emoji: "📢" },
{ label: "Updates", value: "updates", emoji: "🔔" },
{ label: "Gaming", value: "gaming", emoji: "🎮" },
{ label: "Art", value: "art", emoji: "🎨" },
),
);
await channel.send({ content: "Subscribe to channels:", components: [row] });
// Handle selection:
client.on("interactionCreate", async (interaction) => {
if (!interaction.isComponent() || interaction.customId !== "role_select") return;
const selected = interaction.values; // e.g. ["announcements", "gaming"]
await interaction.reply({
content: `✅ Subscribed to: ${selected.join(", ")}`,
ephemeral: true,
});
});