Class: SlackChatter::Api::Im

Inherits:
Base
  • Object
show all
Defined in:
lib/slack_chatter/api/im.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#bool_as_i, #call_method, #channel_id_or_name, #initialize

Constructor Details

This class inherits a constructor from SlackChatter::Api::Base

Instance Method Details

#close(user_id) ⇒ Object



7
8
9
# File 'lib/slack_chatter/api/im.rb', line 7

def close user_id
  call_method("im", "close", {"user" => user_id})
end

#history(user_id, opts = {}) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/slack_chatter/api/im.rb', line 11

def history user_id, opts={}
  # latest          - End of time range of messages to include in results
  # oldest          - Start of time range of messages to include in results
  # inclusive       - Include messages with latest or oldest timestamp in results (send 0/1)
  # count           - Number of messages to return, between 1 and 1000
  call_method("im", "history", {"user" => user_id}.merge(opts))
end

#listObject



19
20
21
22
# File 'lib/slack_chatter/api/im.rb', line 19

def list
  # exclude_archives - Don't return archived im (send 0/1)
  call_method("im", "list", {})
end

#mark(user_id, epoch_time_stamp) ⇒ Object



24
25
26
27
# File 'lib/slack_chatter/api/im.rb', line 24

def mark user_id, epoch_time_stamp
  # ts               - Timestamp of the most recently seen message
  call_method("im", "mark", {"user" => user_id, "ts" => epoch_time_stamp})
end

#open(user_id) ⇒ Object



29
30
31
# File 'lib/slack_chatter/api/im.rb', line 29

def open user_id
  call_method("im", "open", {"user" => user_id})
end