Button

Represents a button component.

Signature

export declare class Button extends BaseComponentBuilder<APIButtonComponent>
JSDoc
@templateType - The type of the button component.

Methods

setCustomId(id: string): this;

Sets the custom ID for the button.

Parameters
id
The custom ID to set.
Returns

The modified Button instance.

setURL(url: string): this;

Sets the URL for the button.

Parameters
url
The URL to set.
Returns

The modified Button instance.

setLabel(label: string): this;

Sets the label for the button.

Parameters
label
The label to set.
Returns

The modified Button instance.

setEmoji(emoji: EmojiResolvable): this;

Sets the emoji for the button.

Parameters
emoji
The emoji to set.
Returns

The modified Button instance.

setDisabled(disabled?: boolean): this;

Sets the disabled state of the button.

Parameters
disabled
Whether the button should be disabled or not.
Returns

The modified Button instance.