Module: Slack::Web::Api::Endpoints::Dialog
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/dialog.rb
Instance Method Summary collapse
-
#dialog_open(options = {}) ⇒ Object
Open a dialog with a user.
Instance Method Details
#dialog_open(options = {}) ⇒ Object
Open a dialog with a user
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/slack/web/api/endpoints/dialog.rb', line 17 def dialog_open( = {}) throw ArgumentError.new('Required arguments :dialog missing') if [:dialog].nil? throw ArgumentError.new('Required arguments :trigger_id missing') if [:trigger_id].nil? # dialog must be passed as an encoded JSON string if .key?(:dialog) dialog = [:dialog] dialog = JSON.dump(dialog) unless dialog.is_a?(String) = .merge(dialog: dialog) end post('dialog.open', ) end |