ActionsBlock

init

Creates an ActionsBlock instance for the given event type and payload.

NameTypeRequiredDefaultDescription

No arguments

Return: The ActionsBlock instance.

id

Sets a custom identifier for the ActionsBlock instance.

NameTypeRequiredDefaultDescription

id

string

true

The custom identifier for the ActionsBlock instance.

Return: The ActionsBlock instance.

button

Adds a ButtonElement to this ActionsBlock instance.

ButtonElement
NameTypeRequiredDefaultDescription

text

string

true

The text of the new button element.

Return: The new ButtonElement instance.

Throws: Megaphone.Provider.SlackBlockException when more than 25 elements are added.

getMemento

Converts the ActionsBlock instance to a serializable format.

NameTypeRequiredDefaultDescription

No arguments

Return: (struct) A struct representing this ActionsBlock instance.

Throws: Megaphone.Provider.SlackBlockException when either 0 or more than 25 elements are present.

{
    "type": "actions"
    "elements": [ ... ],
    "block_id": "optional"
}

Last updated