Noizu.Slack.Chat (Noizu.Slack v0.1.0)

Copy Markdown View Source

Messaging (chat.*).

text_or_opts is either the message text (binary) or a map/keyword of message fields — :text, :blocks, :thread_ts, :reply_broadcast, :unfurl_links, :unfurl_media, :mrkdwn, :attachments, :metadata, :username, :icon_emoji, … Extra message fields may also be given in opts (they are merged over text_or_opts); request-level keys (:token, :headers, :encoding) are never sent to Slack.

Chat.post_message(client, "C123", "hello")
Chat.post_message(client, "C123", %{text: "fallback", blocks: blocks}, thread_ts: ts)

Summary

Functions

POST chat.delete — deletes the message at ts in channel.

POST chat.postEphemeral — posts a message only user can see in channel.

POST chat.postMessage — posts a message (text and/or blocks) to a channel or thread.

POST chat.update — edits the message at ts in channel.

Types

content()

@type content() :: String.t() | map() | keyword()

Functions

delete(client, channel, ts, opts \\ [])

POST chat.delete — deletes the message at ts in channel.

post_ephemeral(client, channel, user, text_or_opts, opts \\ [])

POST chat.postEphemeral — posts a message only user can see in channel.

post_message(client, channel, text_or_opts, opts \\ [])

POST chat.postMessage — posts a message (text and/or blocks) to a channel or thread.

update(client, channel, ts, text_or_opts, opts \\ [])

POST chat.update — edits the message at ts in channel.