Slack v0.9.2 Slack.Web.Chat
Summary
Functions
Deletes a message.
Required Params
channel
- Channel containing the message to be deleted.ts
- Timestamp of the message to be deleted. ex:1405894322.002768
Errors the API can return:
cant_delete_message
- Authenticated user does not have permission to delete this message.channel_not_found
- Value passed forchannel
was invalid.compliance_exports_prevent_deletion
- Compliance exports are on, messages can not be deletedmessage_not_found
- No message exists with the requested timestamp.
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. Overridesicon_url
. Must be used in conjunction withas_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 withas_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 tonone
. 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 withas_user
set to false, otherwise ignored. See authorship below. ex:My Bot
Errors the API can return:
channel_not_found
- Value passed forchannel
was invalid.is_archived
- Channel has been archived.msg_too_long
- Message text is too longno_text
- No message text providednot_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
Updates a message.
Required Params
channel
- Channel containing the message to be updated.text
- New text for the message, using the default formatting rules. ex:Hello world
ts
- Timestamp of the message to be updated. ex:1405894322.002768
Optional Params
as_user
- Pass true to update the message as the authed user. Bot users in this context are considered authed users. ex:true
attachments
- Structured message attachments. ex:[{"pretext": "pre-hello", "text": "text-world"}]
link_names
- Find and link channel names and usernames. Defaults tonone
. This parameter should be used in conjunction withparse
. To setlink_names
to1
, specify aparse
mode offull
. ex:1
parse
- Change how messages are treated. Defaults toclient
, unlikechat.postMessage
. See below. ex:none
Errors the API can return:
cant_update_message
- Authenticated user does not have permission to update this message.channel_not_found
- Value passed forchannel
was invalid.edit_window_closed
- The message cannot be edited due to the team message edit settingsmessage_not_found
- No message exists with the requested timestamp.msg_too_long
- Message text is too longno_text
- No message text provided