Skip to content

Button

Represents a button component.

Type parameters

Type parameterValueDescription
Type extends booleanbooleanThe type of the button component.

Constructors

new Button(data)

1
new Button<Type>(data: Partial<When<Type, APIButtonComponentWithCustomId, APIButtonComponentWithURL>>): Button<Type>

Creates a new Button instance.

Parameters

ParameterTypeDescription
dataPartial<When<Type, APIButtonComponentWithCustomId, APIButtonComponentWithURL>>The initial data for the button.

Returns

Button<Type>

Source

seyfert/src/builders/Button.ts:23

Properties

PropertyModifierTypeDescription
datapublicPartial<When<Type, APIButtonComponentWithCustomId, APIButtonComponentWithURL>>The initial data for the button.

Methods

setCustomId()

1
setCustomId(id: string): Button<Type>

Sets the custom ID for the button.

Parameters

ParameterTypeDescription
idstringThe custom ID to set.

Returns

Button<Type>

The modified Button instance.

Source

seyfert/src/builders/Button.ts:32


setDisabled()

1
setDisabled(disabled: boolean): Button<Type>

Sets the disabled state of the button.

Parameters

ParameterTypeDefault valueDescription
disabledbooleantrueWhether the button should be disabled or not.

Returns

Button<Type>

The modified Button instance.

Source

seyfert/src/builders/Button.ts:76


setEmoji()

1
setEmoji(emoji: EmojiResolvable): Button<Type>

Sets the emoji for the button.

Parameters

ParameterTypeDescription
emojiEmojiResolvableThe emoji to set.

Returns

Button<Type>

The modified Button instance.

Source

seyfert/src/builders/Button.ts:64


setLabel()

1
setLabel(label: string): Button<Type>

Sets the label for the button.

Parameters

ParameterTypeDescription
labelstringThe label to set.

Returns

Button<Type>

The modified Button instance.

Source

seyfert/src/builders/Button.ts:54


setStyle()

1
setStyle(style: ButtonStyle): Button<Type>

Parameters

ParameterType
styleButtonStyle

Returns

Button<Type>

Source

seyfert/src/builders/Button.ts:81


setURL()

1
setURL(url: string): Button<Type>

Sets the URL for the button.

Parameters

ParameterTypeDescription
urlstringThe URL to set.

Returns

Button<Type>

The modified Button instance.

Source

seyfert/src/builders/Button.ts:43


toJSON()

1
toJSON(): When<Type, APIButtonComponentWithCustomId, APIButtonComponentWithURL>

Converts the Button instance to its JSON representation.

Returns

When<Type, APIButtonComponentWithCustomId, APIButtonComponentWithURL>

The JSON representation of the Button instance.

Source

seyfert/src/builders/Button.ts:90