Represents a button builder.
Extends
BuilderButtonComponentConstructs a new instance of the
ButtonBuilder class| Name | Type | Optional | Description |
|---|---|---|---|
| data | Partial<ButtonComponentData> | Partial<APIButtonComponent> | Yes | None |
The API data associated with this component.
Inherited from ComponentBuilderCreates a new button builder from JSON data
| Name | Type | Optional | Description |
|---|---|---|---|
| other | JSONEncodable<APIButtonComponent> | APIButtonComponent | No | The other data |
Sets the custom id for this button.
Remarks
This method is only applicable to buttons that are not using theLink button style.| Name | Type | Optional | Description |
|---|---|---|---|
| customId | string | No | The custom id to use |
Sets whether this button is disabled.
| Name | Type | Optional | Description |
|---|---|---|---|
| disabled | boolean | Yes | Whether to disable this button |
Sets the emoji to display on this button
| Name | Type | Optional | Description |
|---|---|---|---|
| emoji | ComponentEmojiResolvable | No | The emoji to display on this button |
Sets the label for this button.
| Name | Type | Optional | Description |
|---|---|---|---|
| label | string | No | The label to use |
Sets the style of this button.
| Name | Type | Optional | Description |
|---|---|---|---|
| style | ButtonStyle | No | The style to use |
Sets the URL for this button.
Remarks
This method is only available to buttons using theLink button style. Only three types of URL schemes are currently supported: https://, http://, and discord://.| Name | Type | Optional | Description |
|---|---|---|---|
| url | string | No | The URL to use |
Serializes this builder to API-compatible JSON data.