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
) -- -
:ts
(timestamp
) -- -
:channel
(channel
) --
def chat_delete(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] post('chat.delete', options) end
def chat_meMessage(options = {})
- See: https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.meMessage.json -
See: https://api.slack.com/methods/chat.meMessage -
Options Hash:
(**options)
-
:text
(Object
) -- -
:channel
(channel
) --
def chat_meMessage(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :text missing') if options[:text].nil? post('chat.meMessage', options) end
def chat_postEphemeral(options = {})
- See: https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json -
See: https://api.slack.com/methods/chat.postEphemeral -
Options Hash:
(**options)
-
:parse
(Object
) -- -
:link_names
(Object
) -- -
:attachments
(Object
) -- -
:as_user
(Object
) -- -
:user
(user
) -- -
:text
(Object
) -- -
:channel
(channel
) --
def chat_postEphemeral(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :text missing') if options[:text].nil? throw ArgumentError.new('Required arguments :user missing') if options[:user].nil? options = options.merge(user: users_id(options)['user']['id']) if options[:user] # 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.postEphemeral', 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)
-
:username
(Object
) -- -
:unfurl_media
(Object
) -- -
:unfurl_links
(Object
) -- -
:thread_ts
(Object
) -- -
:reply_broadcast
(Object
) -- -
:parse
(Object
) -- -
:link_names
(Object
) -- -
:icon_url
(Object
) -- -
:icon_emoji
(Object
) -- -
:attachments
(Object
) -- -
:as_user
(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_unfurl(options = {})
- See: https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.unfurl.json -
See: https://api.slack.com/methods/chat.unfurl -
Options Hash:
(**options)
-
:user_auth_url
(Object
) -- -
:user_auth_required
(Object
) -- -
:user_auth_message
(Object
) -- -
:unfurls
(Object
) -- -
:ts
(timestamp
) -- -
:channel
(channel
) --
def chat_unfurl(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil? throw ArgumentError.new('Required arguments :unfurls missing') if options[:unfurls].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] post('chat.unfurl', 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)
-
:parse
(Object
) -- -
:link_names
(Object
) -- -
:attachments
(Object
) -- -
:as_user
(Object
) -- -
:ts
(timestamp
) -- -
:text
(Object
) -- -
:channel
(channel
) --
def chat_update(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? throw ArgumentError.new('Required arguments :ts missing') if options[:ts].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