lib/slack/real_time/api/message.rb in slack-ruby-client-1.1.0 vs lib/slack/real_time/api/message.rb in slack-ruby-client-2.0.0

- old
+ new

@@ -10,11 +10,12 @@ # Channel to send message to. Can be a public channel, private group or IM channel. # Can be an encoded ID, or a name. # @option options [Object] :text # Text of the message to send. See below for an explanation of formatting. def message(options = {}) - throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? - throw ArgumentError.new('Required arguments :text missing') if options[:text].nil? + raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil? + raise ArgumentError, 'Required arguments :text missing' if options[:text].nil? + send_json({ type: 'message', id: next_id }.merge(options)) end end end end