discord-container-builder
Version:
A simplified, developer-friendly API for Discord.js v2 Components that reduces boilerplate and improves code readability.
90 lines • 2.84 kB
TypeScript
import { ButtonBuilder as DiscordButtonBuilder, ButtonStyle } from 'discord.js';
/**
* Simplified ButtonBuilder that provides a cleaner API for creating button components
*/
export declare class ButtonBuilder {
private readonly button;
constructor();
/**
* Set the custom ID of the button
* @param customId - The custom ID
* @returns The ButtonBuilder instance for chaining
*/
setCustomId(customId: string): this;
/**
* Set the label of the button
* @param label - The button label
* @returns The ButtonBuilder instance for chaining
*/
setLabel(label: string): this;
/**
* Set the style of the button
* @param style - The button style
* @returns The ButtonBuilder instance for chaining
*/
setStyle(style: ButtonStyle): this;
/**
* Set the emoji of the button
* @param emoji - The emoji
* @returns The ButtonBuilder instance for chaining
*/
setEmoji(emoji: string): this;
/**
* Set the URL for link buttons
* @param url - The URL
* @returns The ButtonBuilder instance for chaining
*/
setURL(url: string): this;
/**
* Set whether the button is disabled
* @param disabled - Whether the button is disabled
* @returns The ButtonBuilder instance for chaining
*/
setDisabled(disabled?: boolean): this;
/**
* Create a primary button
* @param customId - The custom ID
* @param label - The button label
* @returns The ButtonBuilder instance for chaining
*/
asPrimary(customId: string, label: string): this;
/**
* Create a secondary button
* @param customId - The custom ID
* @param label - The button label
* @returns The ButtonBuilder instance for chaining
*/
asSecondary(customId: string, label: string): this;
/**
* Create a success button
* @param customId - The custom ID
* @param label - The button label
* @returns The ButtonBuilder instance for chaining
*/
asSuccess(customId: string, label: string): this;
/**
* Create a danger button
* @param customId - The custom ID
* @param label - The button label
* @returns The ButtonBuilder instance for chaining
*/
asDanger(customId: string, label: string): this;
/**
* Create a link button
* @param url - The URL
* @param label - The button label
* @returns The ButtonBuilder instance for chaining
*/
asLink(url: string, label: string): this;
/**
* Build the final Discord.js ButtonBuilder
* @returns The Discord.js ButtonBuilder instance
*/
build(): DiscordButtonBuilder;
/**
* Get the JSON representation of the button
* @returns The JSON data
*/
toJSON(): any;
}
//# sourceMappingURL=ButtonBuilder.d.ts.map