Component & Embed Builders
lunibee (builders) provides strict builders that validate Discord constraints before network dispatch.
Embed Builder
Section titled “Embed Builder”import { CreateEmbed } from "lunibee";const embed = new CreateEmbed() .setTitle("Lunibee Status 🐝") .setDescription("All systems fully operational.") .setColor(0xf59e0b) .setThumbnail("https://example.com/icon.png") .addFields( { name: "Ping", value: "24ms", inline: true }, { name: "Uptime", value: "99.99%", inline: true } ) .setFooter({ text: "Powered by Bun & Lunibee" }) .setTimestamp();import { CreateEmbed } from "lunibee";const embed = new CreateEmbed() .setTitle("Lunibee Status 🐝") .setDescription("All systems fully operational.") .setColor(0xf59e0b) .setThumbnail("https://example.com/icon.png") .addFields( { name: "Ping", value: "24ms", inline: true }, { name: "Uptime", value: "99.99%", inline: true } ) .setFooter({ text: "Powered by Bun & Lunibee" }) .setTimestamp();Button & Action Row Builders
Section titled “Button & Action Row Builders”import { CreateActionRow, CreateButton, ButtonType } from "lunibee";const primaryBtn = new CreateButton() .setCustomId("primary_action") .setLabel("Click Me!") .setStyle(ButtonType.Primary) .setEmoji("🚀");const linkBtn = new CreateButton() .setLabel("Documentation") .setStyle(ButtonType.Link) .setURL("https://github.com/Ekretos/lunibee");const row = new CreateActionRow().addComponents(primaryBtn, linkBtn);await channel.send({ content: "Choose an option:", components: [row],});import { CreateActionRow, CreateButton, ButtonType } from "lunibee";const primaryBtn = new CreateButton() .setCustomId("primary_action") .setLabel("Click Me!") .setStyle(ButtonType.Primary) .setEmoji("🚀");const linkBtn = new CreateButton() .setLabel("Documentation") .setStyle(ButtonType.Link) .setURL("https://github.com/Ekretos/lunibee");const row = new CreateActionRow().addComponents(primaryBtn, linkBtn);await channel.send({ content: "Choose an option:", components: [row],});Select Menu Builders
Section titled “Select Menu Builders”import { CreateActionRow, CreateStringSelect } from "lunibee";const select = new CreateStringSelect() .setCustomId("select_role") .setPlaceholder("Select a role...") .addOptions( { label: "Developer", value: "dev", emoji: { name: "💻" } }, { label: "Designer", value: "designer", emoji: { name: "🎨" } } );const row = new CreateActionRow().addComponents(select);import { CreateActionRow, CreateStringSelect } from "lunibee";const select = new CreateStringSelect() .setCustomId("select_role") .setPlaceholder("Select a role...") .addOptions( { label: "Developer", value: "dev", emoji: { name: "💻" } }, { label: "Designer", value: "designer", emoji: { name: "🎨" } } );const row = new CreateActionRow().addComponents(select);Entity Select Menus
Section titled “Entity Select Menus”For user, role, mentionable and channel pickers, use the fixed-type builders (or
CreateEntitySelect with a component type).
import { CreateUserSelect, CreateRoleSelect, CreateChannelSelect, CreateMentionableSelect,} from "lunibee";
const pickUser = new CreateUserSelect().setCustomId("pick_user");Context Menu Commands
Section titled “Context Menu Commands”import { CreateContextMenuCommand, CreateUserCommand, CreateMessageCommand } from "lunibee";
new CreateContextMenuCommand().setName("Report").setType(3); // 2 = USER, 3 = MESSAGEnew CreateUserCommand().setName("View Profile"); // type 2new CreateMessageCommand().setName("Quote"); // type 3Validation on Serialization
Section titled “Validation on Serialization”toJSON() checks a component as a whole, so mistakes fail locally instead of
as a Discord 400: buttons need a custom ID (a URL for links, a SKU for premium
buttons via setSKUId()) and, except premium buttons, a label or emoji; selects
need a custom ID and min_values <= max_values (string selects also at least one
option); a select or text input must be alone in its action
row; modals need a custom ID, title and at least one component.