Sha256: 25d79b2da9275a40f985db6f7141da01d4f869a10a27b24433724beb4bd7e9fe

Contents?: true

Size: 802 Bytes

Versions: 8

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true
module Slack
  module RealTime
    module Api
      module Message
        #
        # Sends a message to a channel.
        #
        # @option options [channel] :channel
        #   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?
          send_json({ type: 'message', id: next_id }.merge(options))
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
slack-ruby-client-1.1.0 lib/slack/real_time/api/message.rb
slack-ruby-client-1.0.0 lib/slack/real_time/api/message.rb
slack-ruby-client-0.17.0 lib/slack/real_time/api/message.rb
slack-ruby-client-0.16.0 lib/slack/real_time/api/message.rb
slack-ruby-client-0.15.1 lib/slack/real_time/api/message.rb
slack-ruby-client-0.15.0 lib/slack/real_time/api/message.rb
slack-ruby-client-0.14.6 lib/slack/real_time/api/message.rb
slack-ruby-client-0.14.5 lib/slack/real_time/api/message.rb