discord-container-builder
Version:
A simplified, developer-friendly API for Discord.js v2 Components that reduces boilerplate and improves code readability.
77 lines • 2.81 kB
TypeScript
import { StringSelectMenuBuilder as DiscordStringSelectMenuBuilder, StringSelectMenuOptionBuilder } from 'discord.js';
export interface SelectOption {
label: string;
value: string;
description?: string;
emoji?: string;
default?: boolean;
}
/**
* Simplified StringSelectMenuBuilder that provides a cleaner API for creating select menu components
*/
export declare class StringSelectMenuBuilder {
private readonly selectMenu;
constructor();
/**
* Set the custom ID of the select menu
* @param customId - The custom ID
* @returns The StringSelectMenuBuilder instance for chaining
*/
setCustomId(customId: string): this;
/**
* Set the placeholder text
* @param placeholder - The placeholder text
* @returns The StringSelectMenuBuilder instance for chaining
*/
setPlaceholder(placeholder: string): this;
/**
* Set the minimum number of values that can be selected
* @param min - The minimum values
* @returns The StringSelectMenuBuilder instance for chaining
*/
setMinValues(min: number): this;
/**
* Set the maximum number of values that can be selected
* @param max - The maximum values
* @returns The StringSelectMenuBuilder instance for chaining
*/
setMaxValues(max: number): this;
/**
* Set whether the select menu is disabled
* @param disabled - Whether the select menu is disabled
* @returns The StringSelectMenuBuilder instance for chaining
*/
setDisabled(disabled?: boolean): this;
/**
* Add options to the select menu
* @param options - Array of option objects or StringSelectMenuOptionBuilder instances
* @returns The StringSelectMenuBuilder instance for chaining
*/
addOptions(options: (SelectOption | StringSelectMenuOptionBuilder)[]): this;
/**
* Add a single option with simplified API
* @param label - The option label
* @param value - The option value
* @param description - Optional description
* @param emoji - Optional emoji
* @returns The StringSelectMenuBuilder instance for chaining
*/
addOption(label: string, value: string, description?: string, emoji?: string): this;
/**
* Set options (replaces existing options)
* @param options - Array of option objects
* @returns The StringSelectMenuBuilder instance for chaining
*/
setOptions(options: SelectOption[]): this;
/**
* Build the final Discord.js StringSelectMenuBuilder
* @returns The Discord.js StringSelectMenuBuilder instance
*/
build(): DiscordStringSelectMenuBuilder;
/**
* Get the JSON representation of the select menu
* @returns The JSON data
*/
toJSON(): any;
}
//# sourceMappingURL=StringSelectMenuBuilder.d.ts.map