module Slack::Web::Api::Endpoints::Chat

def chat_postEphemeral(options = {})

Other tags:
    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