module Slack::Web::Api::Endpoints::Chat
def chat_command(options = {})
- See: https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/chat/chat.command.json -
Options Hash:
(**options)-
:text(Object) -- -
:command(Object) -- -
:channel(channel) --
def chat_command(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :command missing') if options[:command].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] logger.warn('The chat.command method is undocumented.') post('chat.command', options) end
def chat_delete(options = {})
- See: https://github.com/slack-ruby/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_deleteScheduledMessage(options = {})
- See: https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.deleteScheduledMessage.json -
See: https://api.slack.com/methods/chat.deleteScheduledMessage -
Options Hash:
(**options)-
:as_user(Object) -- -
:scheduled_message_id(Object) -- -
:channel(channel) --
def chat_deleteScheduledMessage(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :scheduled_message_id missing') if options[:scheduled_message_id].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] post('chat.deleteScheduledMessage', options) end
def chat_getPermalink(options = {})
- See: https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.getPermalink.json -
See: https://api.slack.com/methods/chat.getPermalink -
Options Hash:
(**options)-
:message_ts(Object) -- -
:channel(channel) --
def chat_getPermalink(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :message_ts missing') if options[:message_ts].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] post('chat.getPermalink', options) end
def chat_meMessage(options = {})
- See: https://github.com/slack-ruby/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/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json -
See: https://api.slack.com/methods/chat.postEphemeral -
Options Hash:
(**options)-
:username(Object) -- -
:thread_ts(Object) -- -
:parse(Object) -- -
:link_names(Object) -- -
:icon_url(Object) -- -
:icon_emoji(Object) -- -
:blocks(Object) -- -
:as_user(Object) -- -
:user(user) -- -
:text(Object) -- -
:channel(channel) -- -
:attachments(Object) --
def chat_postEphemeral(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].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 # blocks must be passed as an encoded JSON string if options.key?(:blocks) blocks = options[:blocks] blocks = JSON.dump(blocks) unless blocks.is_a?(String) options = options.merge(blocks: blocks) end post('chat.postEphemeral', options) end
def chat_postMessage(options = {})
- See: https://github.com/slack-ruby/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) -- -
:mrkdwn(Object) -- -
:link_names(Object) -- -
:icon_url(Object) -- -
:icon_emoji(Object) -- -
:blocks(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, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].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 # blocks must be passed as an encoded JSON string if options.key?(:blocks) blocks = options[:blocks] blocks = JSON.dump(blocks) unless blocks.is_a?(String) options = options.merge(blocks: blocks) end post('chat.postMessage', options) end
def chat_scheduleMessage(options = {})
- See: https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.scheduleMessage.json -
See: https://api.slack.com/methods/chat.scheduleMessage -
Options Hash:
(**options)-
:unfurl_media(Object) -- -
:unfurl_links(Object) -- -
:thread_ts(Object) -- -
:reply_broadcast(Object) -- -
:parse(Object) -- -
:link_names(Object) -- -
:blocks(Object) -- -
:attachments(Object) -- -
:as_user(Object) -- -
:text(Object) -- -
:post_at(Object) -- -
:channel(channel) --
def chat_scheduleMessage(options = {}) throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :post_at missing') if options[:post_at].nil? throw ArgumentError.new('Required arguments :text missing') if options[:text].nil? post('chat.scheduleMessage', options) end
def chat_unfurl(options = {})
- See: https://github.com/slack-ruby/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/slack-ruby/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) -- -
:blocks(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, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].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 # blocks must be passed as an encoded JSON string if options.key?(:blocks) blocks = options[:blocks] blocks = JSON.dump(blocks) unless blocks.is_a?(String) options = options.merge(blocks: blocks) end post('chat.update', options) end