Slackblocks.WebhookMessage (slackblocks v2.8.0)
View SourceA payload for incoming webhooks.
Slack reference: https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks
Fields
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. Optional;nilomits the field.response_type— Sets who can see the response. Optional;nilomits the field.replace_original— Sets whether the response replaces the message that triggered it. Optional;nilomits the field.delete_original— Sets whether the response deletes the message that triggered it. 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.WebhookMessage{ attachments: [Slackblocks.Attachment.t()] | nil, blocks: [Slackblocks.Types.block()] | nil, delete_original: boolean() | nil, metadata: %{optional(binary()) => Slackblocks.Types.json()} | nil, replace_original: boolean() | nil, response_type: Slackblocks.Types.response_type() | 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.