ImageBlock

init

Creates an ImageBlock instance.

Return: The ImageBlock instance.

id

Sets a custom identifier for the ImageBlock instance.

Return: The ImageBlock instance.

alt

Sets the alt text for the ImageBlock instance.

Return: The ImageBlock instance.

title

Sets the title for the ImageBlock instance.

Return: The ImageBlock instance.

getMemento

Converts the ImageBlock instance to a serializable format.

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

{
    "type": "image",
    "image_url": "https://placekitten.com/200/300",
    "alt_text": "A cute kitten",
    "block_id": "optional"
    "text": {
        "type": "plain_text",
        "text": "My Title"
    },
}

Last updated