Sha256: 3107a2e5a214fca042e439aad3103cdac53b7c1d58056578707ae5763fba310d

Contents?: true

Size: 836 Bytes

Versions: 2

Compression:

Stored size: 836 Bytes

Contents

diff --git a/lib/slack/web/api/endpoints/dialog.rb b/lib/slack/web/api/endpoints/dialog.rb
index 05475c8..a4ff4ff 100644
--- a/lib/slack/web/api/endpoints/dialog.rb
+++ b/lib/slack/web/api/endpoints/dialog.rb
@@ -18,6 +18,12 @@ module Slack
           def dialog_open(options = {})
             raise ArgumentError, 'Required arguments :dialog missing' if options[:dialog].nil?
             raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
+            # dialog must be passed as an encoded JSON string
+            if options.key?(:dialog)
+              dialog = options[:dialog]
+              dialog = JSON.dump(dialog) unless dialog.is_a?(String)
+              options = options.merge(dialog: dialog)
+            end
             post('dialog.open', options)
           end
         end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slack-ruby-client-2.1.0 lib/slack/web/api/patches/dialog.encoded-json.patch
slack-ruby-client-2.0.0 lib/slack/web/api/patches/dialog.encoded-json.patch