Slackblocks.Message (slackblocks v2.8.0)
View SourceA complete payload for chat.postMessage and related Web API methods.
Slack reference: https://docs.slack.dev/reference/methods/chat.postMessage
Fields
channel— Sets the ID of the channel, private group, or conversation that receives the message. Required.blocks— Adds the message blocks in display order. Optional;nilomits the field.attachments— Adds legacy attachments in display order. Optional;nilomits the field.text— Sets the fallback text used in notifications and by clients that cannot display blocks. Default:"". Optional;nilomits the field.mrkdwn— Sets whether Slack formats the top-level text as mrkdwn. Default:true. Optional;nilomits the field.unfurl_links— Sets whether Slack unfurls text-based links. Optional;nilomits the field.unfurl_media— Sets whether Slack unfurls media links. Optional;nilomits the field.metadata— Sets message metadata as a JSON-compatible map, such as event_type and event_payload. 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.Message{ attachments: [Slackblocks.Attachment.t()] | nil, blocks: [Slackblocks.Types.block()] | nil, channel: binary(), metadata: %{optional(binary()) => Slackblocks.Types.json()} | nil, mrkdwn: boolean() | nil, text: binary() | nil, unfurl_links: boolean() | nil, unfurl_media: boolean() | 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.