Skip to content

MessageActionRow

Extends: None

Represents an action row containing message components.

Description

Provides methods for adding and removing message compoenents from an action row.

Properties

Type Name Description
Array components The components in this action row

Methods

Returns Definition
MessageActionRow add_component(component: Variant))
void print())
MessageActionRow slice_components(index: int, delete_count: int, replace_components?: Array)

Method Descriptions

add_component(component)

Adds a component to the action row.

Returns: MessageActionRow

Type Parameter
MessageButton | SelectMenu component

The MessageActionRow can have a maximum of 5 components.

The MessageActionRow cannot contain another MessageActionRow.

Examples

Create and send a MessageButton

var button = MessageButton.new().set_style(MessageButton.STYLES.DEFAULT)\
                .set_label("A")\
                .set_custom_id("primary_custom")

var row = MessageActionRow.new().add_component(button)

yield(bot.send(message, {
    "components": [row]
}))

slice_components(index, delete_count, replace_components?)

Removes, replaces, and inserts components in the action row.

Returns: MessageActionRow

Type Parameter Description
int index The starting index from which to start deletion
int delete_count Number of components to delete (default is 1)
Array replace_components An array of components to replace the deleted ones

print()

Prints the MessageActionRow

Returns: void

Note

Use this instead of print(MessageActionRow)

Back to top