Slackblocks.Elements.Image (slackblocks v2.8.0)

View Source

An image displayed inside a section, context, or card.

Slack reference: https://docs.slack.dev/reference/block-kit/block-elements/image-element

Fields

  • alt_text — Sets a plain-text summary of the image or video for assistive technology. Required.
  • image_url — Sets the publicly accessible URL of the image. Cannot be combined with a Slack file. Optional; nil omits the field.
  • slack_file — Sets a file hosted in Slack as the image source. Cannot be combined with an image URL. Optional; nil omits the field.

Summary

Functions

Atomically replaces supplied fields; omitted fields retain their values.

Constructs and validates a value. Text conveniences apply to keyword input.

Constructs a value or raises Slackblocks.ValidationError.

Types

t()

@type t() :: %Slackblocks.Elements.Image{
  alt_text: binary(),
  image_url: binary() | nil,
  slack_file: Slackblocks.Objects.SlackFile.t() | nil
}

Functions

change(value, options)

@spec change(
  t(),
  keyword()
) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}

Atomically replaces supplied fields; omitted fields retain their values.

change!(value, options)

@spec change!(
  t(),
  keyword()
) :: t()

Replaces fields or raises Slackblocks.ValidationError.

new(options)

@spec new(keyword()) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}

Constructs and validates a value. Text conveniences apply to keyword input.

new!(options)

@spec new!(keyword()) :: t()

Constructs a value or raises Slackblocks.ValidationError.