Sha256: 5204a68514d579469a1b2c1aed42c9181d3ce94660d4b8748aa44d9c90b4fca6
Contents?: true
Size: 914 Bytes
Versions: 14
Compression:
Stored size: 914 Bytes
Contents
diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb index 846126e..0c254c6 100644 --- a/lib/slack/web/api/endpoints/chat.rb +++ b/lib/slack/web/api/endpoints/chat.rb @@ -62,6 +62,12 @@ module Slack 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
Version data entries
14 entries across 14 versions & 1 rubygems