SlackWeb.Chat.post_message

You're seeing just the function post_message, go back to SlackWeb.Chat module for more information.
Link to this function

post_message(channel, text, optional_params \\ %{})

View Source

Sends a message to a channel.

Required Params

  • channel - Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
  • text - Text of the message to send. See below for an explanation of formatting. ex: Hello world

Optional Params

  • as_user - Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. ex: true
  • attachments - Structured message attachments. ex: [{"pretext": "pre-hello", "text": "text-world"}]
  • icon_emoji - emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. ex: :chart_with_upwards_trend:
  • icon_url - URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. ex: http://lorempixel.com/48/48
  • link_names - Find and link channel names and usernames. ex: 1
  • parse - Change how messages are treated. Defaults to none. See below. ex: full
  • unfurl_links - Pass true to enable unfurling of primarily text-based content. ex: true
  • unfurl_media - Pass false to disable unfurling of media content. ex: false
  • username - Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. ex: My Bot

Errors the API can return:

  • channel_not_found - Value passed for channel was invalid.
  • is_archived - Channel has been archived.
  • msg_too_long - Message text is too long
  • no_text - No message text provided
  • not_in_channel - Cannot post user messages to a channel they are not in.
  • rate_limited - Application has posted too many messages, read the Rate Limit documentation for more information