class Slack::API::IM

Public Instance Methods

all(page: nil) click to toggle source
# File lib/laziness/api/im.rb, line 4
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
close(channel) click to toggle source
# File lib/laziness/api/im.rb, line 12
def close(channel)
  with_nil_response { request :post, 'im.close', channel: channel }
end
mark(channel, timestamp) click to toggle source
# File lib/laziness/api/im.rb, line 16
def mark(channel, timestamp)
  with_nil_response { request :post, 'im.mark', channel: channel, ts: timestamp }
end
open(user_id) click to toggle source
# File lib/laziness/api/im.rb, line 20
def open(user_id)
  response = request :post, 'im.open', { user: user_id }
  Slack::Channel.parse response, 'channel'
end