Slackblocks.Blocks.Image (slackblocks v2.8.0)
View SourceA standalone image with alternative text and an optional title.
Slack reference: https://docs.slack.dev/reference/block-kit/blocks/image-block
Fields
image_url— Sets the publicly accessible URL of the image. Cannot be combined with a Slack file. Optional;nilomits the field.slack_file— Sets a file hosted in Slack as the image source. Cannot be combined with an image URL. Optional;nilomits the field.alt_text— Sets a plain-text summary of the image or video for assistive technology. Required.title— Sets the title shown above the image. Optional;nilomits the field.block_id— Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Optional;nilomits the field.
Summary
Functions
Atomically replaces supplied fields; omitted fields retain their values.
Replaces fields or raises Slackblocks.ValidationError.
Constructs and validates a value. Text conveniences apply to keyword input.
Constructs a value or raises Slackblocks.ValidationError.
Types
@type t() :: %Slackblocks.Blocks.Image{ alt_text: binary(), block_id: binary() | nil, image_url: binary() | nil, slack_file: Slackblocks.Objects.SlackFile.t() | nil, title: Slackblocks.Objects.PlainText.t() | nil }
Functions
@spec change( t(), keyword() ) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}
Atomically replaces supplied fields; omitted fields retain their values.
Replaces fields or raises Slackblocks.ValidationError.
@spec new(keyword()) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}
Constructs and validates a value. Text conveniences apply to keyword input.
Constructs a value or raises Slackblocks.ValidationError.