Constructor
new ActionRow()
- Source
Example
const { Button, ButtonStyles, ActionRow } = require("interactions.js");
const row = new ActionRow()
.addComponents() // When you want to add an array of components
.addComponent( // When you only want to add one component
new Button()
.setStyle(ButtonStyles.Secondary) // Set the style of the button
.setLabel('Button') // Set the label of the button
.setEmoji('🎈') // Set the emoji of the button
.setCustomId('custom') // Set the custom id of the button
)
Methods
addComponent(component) → {ActionRow}
Add a component to the action row
Parameters:
Name | Type | Description |
---|---|---|
component | object |
- Source
Returns:
- Type:
- ActionRow
addComponents(components) → {ActionRow}
Add multiple components to the action row
Parameters:
Name | Type | Description |
---|---|---|
components | array |
- Source
Returns:
- Type:
- ActionRow
setComponents(components) → {ActionRow}
Set the components of the action row
Parameters:
Name | Type | Description |
---|---|---|
components | array |
- Source
Returns:
- Type:
- ActionRow