Sha256: ef4dbf9a41ff886cbeacf10d4b429c7cb3a2ba1c1b9f5bf4759f1f5837a4ffcb

Contents?: true

Size: 1.7 KB

Versions: 1

Compression:

Stored size: 1.7 KB

Contents

diff --git a/lib/slack/web/api/endpoints/chat.rb b/lib/slack/web/api/endpoints/chat.rb
index b49065a..bf202f1 100644
--- a/lib/slack/web/api/endpoints/chat.rb
+++ b/lib/slack/web/api/endpoints/chat.rb
@@ -122,7 +122,7 @@ module Slack
           # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postEphemeral.json
           def chat_postEphemeral(options = {})
             raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
-            raise ArgumentError, 'Required arguments :text missing' if options[:text].nil?
+            raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
             raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
             options = options.merge(user: users_id(options)['user']['id']) if options[:user]
             options = encode_options_as_json(options, %i[attachments blocks])
@@ -274,6 +274,7 @@ module Slack
           def chat_update(options = {})
             raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
             raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?
+            raise ArgumentError, 'At least one of :attachments, :blocks, :text, :reply_broadcast is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:reply_broadcast].nil?
             options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
             options = encode_options_as_json(options, %i[attachments blocks metadata])
             post('chat.update', options)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slack-ruby-client-2.2.0 lib/slack/web/api/patches/chat.attachments-blocks.patch