ActionRow
Represents an Action Row component in a message.
Extends
BaseComponentBuilder
<APIActionRowComponent
<APIActionRowComponentTypes
>>
Type parameters
Type parameter | Description |
---|---|
T extends BuilderComponents | The type of components in the Action Row. |
Constructors
new ActionRow(data)
1new ActionRow<T>(data: Partial<APIActionRowComponent<APIActionRowComponentTypes>>): ActionRow<T>
Creates a new instance of the ActionRow class.
Parameters
Parameter | Type | Description |
---|---|---|
data | Partial <APIActionRowComponent <APIActionRowComponentTypes >> | Optional data to initialize the Action Row. |
Returns
ActionRow
<T
>
Overrides
BaseComponentBuilder
.constructor
Example
1const actionRow = new ActionRow<Button>({ components: [buttonRawJSON] });
Source
seyfert/src/builders/ActionRow.ts:25
Properties
Property | Modifier | Type | Inherited from |
---|---|---|---|
components | public | FixedComponents <T >[] | - |
data | public | Partial <APIActionRowComponent <APIActionRowComponentTypes >> | BaseComponentBuilder .data |
Methods
addComponents()
1addComponents(...component: RestOrArray<FixedComponents<T>>): this
Adds one or more components to the Action Row.
Parameters
Parameter | Type | Description |
---|---|---|
…component | RestOrArray <FixedComponents <T >> | The component(s) to add. |
Returns
this
The updated Action Row instance.
Example
1actionRow.addComponents(buttonComponent);2actionRow.addComponents(buttonComponent1, buttonComponent2);3actionRow.addComponents([buttonComponent1, buttonComponent2]);
Source
seyfert/src/builders/ActionRow.ts:41
setComponents()
1setComponents(component: FixedComponents<T>[]): this
Sets the components of the Action Row.
Parameters
Parameter | Type | Description |
---|---|---|
component | FixedComponents <T >[] | The components to set. |
Returns
this
The updated Action Row instance.
Example
1actionRow.setComponents([buttonComponent1, buttonComponent2]);
Source
seyfert/src/builders/ActionRow.ts:53
toJSON()
1toJSON(): APIActionRowComponent<APIMessageActionRowComponent>
Converts the Action Row to its JSON representation.
Returns
APIActionRowComponent
<APIMessageActionRowComponent
>
The JSON representation of the Action Row.