Slackblocks.MessageResponse (slackblocks v2.8.0)

View Source

A response body for slash commands and interaction response URLs.

Slack reference: https://docs.slack.dev/interactivity/handling-user-interaction#message_responses

Fields

  • blocks — Adds the response blocks in display order. Optional; nil omits the field.
  • attachments — Adds legacy attachments in display order. Optional; nil omits the field.
  • text — Sets the fallback text used in notifications and by clients that cannot display blocks. Default: "". Optional; nil omits the field.
  • mrkdwn — Sets whether Slack formats the top-level text as mrkdwn. Default: true. Optional; nil omits the field.
  • replace_original — Sets whether the response replaces the message that triggered it. Default: false. Optional; nil omits the field.
  • response_type — Sets who can see the response. Default: :in_channel. 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.MessageResponse{
  attachments: [Slackblocks.Attachment.t()] | nil,
  blocks: [Slackblocks.Types.block()] | nil,
  mrkdwn: boolean() | nil,
  replace_original: boolean() | nil,
  response_type: Slackblocks.Types.response_type() | nil,
  text: binary() | 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.