A builder that creates API-compatible JSON data for action rows.
Extends
ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>>| Name | Constraints | Optional | Default | Description | 
|---|---|---|---|---|
| T | AnyComponentBuilder | No | The types of components this action row holds | 
constructor({ components, ...data }?)
Creates a new action row from API data.
Example
Creating an action row from an API data object:Example
Creating an action row using setters and API data:| Name | Type | Optional | Description | 
|---|---|---|---|
| { components, ...data } | Partial<APIActionRowComponent<APIActionRowComponentTypes>> | Yes | None | 
Readonly
components
:
T[]
The components within this action row.
Readonly
data
:
Partial<DataType>
The API data associated with this component.
Inherited from ComponentBuilderaddComponents(components)
:
this
Adds components to this action row.
| Name | Type | Optional | Description | 
|---|---|---|---|
| components | RestOrArray<T> | No | The components to add | 
setComponents(components)
:
this
Sets components for this action row.
| Name | Type | Optional | Description | 
|---|---|---|---|
| components | RestOrArray<T> | No | The components to set | 
toJSON()
:
APIActionRowComponent<ReturnType<T['toJSON']>>
Serializes this builder to API-compatible JSON data.