Method: Slack::Web::Api::Endpoints::Chat#chat_update
- Defined in:
- lib/slack/web/api/endpoints/chat.rb
#chat_update(options = {}) ⇒ Object
This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.
84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/slack/web/api/endpoints/chat.rb', line 84 def chat_update( = {}) throw ArgumentError.new('Required arguments :ts missing') if [:ts].nil? throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :text or :attachments missing') if [:text].nil? && [:attachments].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] # attachments must be passed as an encoded JSON string if .key?(:attachments) = [:attachments] = JSON.dump() unless .is_a?(String) = .merge(attachments: ) end post('chat.update', ) end |