ActionRow

Create an action row

Constructor

new ActionRow()

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:
NameTypeDescription
componentobject
Returns:
Type: 
ActionRow

addComponents(components) → {ActionRow}

Add multiple components to the action row

Parameters:
NameTypeDescription
componentsarray
Returns:
Type: 
ActionRow

setComponents(components) → {ActionRow}

Set the components of the action row

Parameters:
NameTypeDescription
componentsarray
Returns:
Type: 
ActionRow