ButtonBuilder
declare class ButtonBuilder extends ComponentBuilder<APIButtonComponent> declare class ButtonBuilder extends ComponentBuilder<APIButtonComponent> Represents a button component
Extends
ComponentBuilder<APIButtonComponentconstructor(data?)
Constructs a new instance of the
ButtonBuilder class| Name | Type | Optional | Description |
|---|---|---|---|
| data | Partial<APIButtonComponent> | Yes | None |
setCustomId(customId)
:
this
Sets the custom id for this button
| Name | Type | Optional | Description |
|---|---|---|---|
| customId | string | No | The custom id to use for this button |
setDisabled(disabled?)
:
this
Sets whether this button is disabled
| Name | Type | Optional | Description |
|---|---|---|---|
| disabled | boolean | Yes | Whether to disable this button |
setEmoji(emoji)
:
this
Sets the emoji to display on this button
| Name | Type | Optional | Description |
|---|---|---|---|
| emoji | APIMessageComponentEmoji | No | The emoji to display on this button |
setLabel(label)
:
this
Sets the label for this button
| Name | Type | Optional | Description |
|---|---|---|---|
| label | string | No | The label to display on this button |
setStyle(style)
:
this
Sets the style of this button
| Name | Type | Optional | Description |
|---|---|---|---|
| style | ButtonStyle | No | The style of the button |
setURL(url)
:
this
Sets the URL for this button
| Name | Type | Optional | Description |
|---|---|---|---|
| url | string | No | The URL to open when this button is clicked |