Button
Represents a button component.
Type parameters
Type parameter | Value | Description |
---|---|---|
Type extends boolean | boolean | The type of the button component. |
Constructors
new Button(data)
Creates a new Button instance.
Parameters
Parameter | Type | Description |
---|---|---|
data | Partial <When <Type , APIButtonComponentWithCustomId , APIButtonComponentWithURL >> | The initial data for the button. |
Returns
Button
<Type
>
Source
seyfert/src/builders/Button.ts:23
Properties
Property | Modifier | Type | Description |
---|---|---|---|
data | public | Partial <When <Type , APIButtonComponentWithCustomId , APIButtonComponentWithURL >> | The initial data for the button. |
Methods
setCustomId()
Sets the custom ID for the button.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The custom ID to set. |
Returns
Button
<Type
>
The modified Button instance.
Source
seyfert/src/builders/Button.ts:32
setDisabled()
Sets the disabled state of the button.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
disabled | boolean | true | Whether the button should be disabled or not. |
Returns
Button
<Type
>
The modified Button instance.
Source
seyfert/src/builders/Button.ts:76
setEmoji()
Sets the emoji for the button.
Parameters
Parameter | Type | Description |
---|---|---|
emoji | EmojiResolvable | The emoji to set. |
Returns
Button
<Type
>
The modified Button instance.
Source
seyfert/src/builders/Button.ts:64
setLabel()
Sets the label for the button.
Parameters
Parameter | Type | Description |
---|---|---|
label | string | The label to set. |
Returns
Button
<Type
>
The modified Button instance.
Source
seyfert/src/builders/Button.ts:54
setStyle()
Parameters
Parameter | Type |
---|---|
style | ButtonStyle |
Returns
Button
<Type
>
Source
seyfert/src/builders/Button.ts:81
setURL()
Sets the URL for the button.
Parameters
Parameter | Type | Description |
---|---|---|
url | string | The URL to set. |
Returns
Button
<Type
>
The modified Button instance.
Source
seyfert/src/builders/Button.ts:43
toJSON()
Converts the Button instance to its JSON representation.
Returns
When
<Type
, APIButtonComponentWithCustomId
, APIButtonComponentWithURL
>
The JSON representation of the Button instance.