module Slack::Web::Api::Endpoints::Chat
def chat_delete(options = {})
- See: https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.delete.json -
See: https://api.slack.com/methods/chat.delete -
Options Hash:
(**options)-
:as_user(Object) -- -
:channel(channel) -- -
:ts(timestamp) --
def chat_delete(options = {}) throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil? throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] post('chat.delete', options) end
def chat_postMessage(options = {})
- See: https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postMessage.json -
See: https://api.slack.com/methods/chat.postMessage -
Options Hash:
(**options)-
:icon_emoji(Object) -- -
:icon_url(Object) -- -
:as_user(Object) -- -
:username(Object) -- -
:unfurl_media(Object) -- -
:unfurl_links(Object) -- -
:attachments(Object) -- -
:link_names(Object) -- -
:parse(Object) -- -
:text(Object) -- -
:channel(channel) --
def chat_postMessage(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil? # attachments must be passed as an encoded JSON string if options.key?(:attachments) attachments = options[:attachments] attachments = JSON.dump(attachments) unless attachments.is_a?(String) options = options.merge(attachments: attachments) end post('chat.postMessage', options) end
def chat_update(options = {})
- See: https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.update.json -
See: https://api.slack.com/methods/chat.update -
Options Hash:
(**options)-
:as_user(Object) -- -
:link_names(Object) -- -
:parse(Object) -- -
:attachments(Object) -- -
:text(Object) -- -
:channel(channel) -- -
:ts(timestamp) --
def chat_update(options = {}) throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil? throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :text or :attachments missing') if options[:text].nil? && options[:attachments].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] # attachments must be passed as an encoded JSON string if options.key?(:attachments) attachments = options[:attachments] attachments = JSON.dump(attachments) unless attachments.is_a?(String) options = options.merge(attachments: attachments) end post('chat.update', options) end