Sha256: 37f5daaf7b5ee0d3419134d8f8030a1152e9f78399e07457ea1b7d81d4f3e5e3

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

module Slack
  module API
    class IM < Base
      def all(page: nil)
        responses = with_paging(page) do |pager|
          request :get, 'im.list', **pager.to_h
        end

        Slack::Channel.parse_all responses, 'ims'
      end

      def close(channel)
        with_nil_response { request :post, 'im.close', channel: channel }
      end

      def mark(channel, timestamp)
        with_nil_response { request :post, 'im.mark', channel: channel, ts: timestamp }
      end

      def open(user_id)
        response = request :post, 'im.open', { user: user_id }
        Slack::Channel.parse response, 'channel'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
laziness-0.2.6 lib/laziness/api/im.rb
laziness-0.2.5 lib/laziness/api/im.rb