Module: Slack::Web::Im
- Included in:
- Slack::Web
- Defined in:
- lib/slack/web/im.rb
Overview
Module for the im methods. Get info on your direct messages.
Constant Summary collapse
- SCOPE =
Endpoint scope
'im'
Instance Method Summary collapse
-
#im_close(params = {}) ⇒ Object
Close a direct message channel.
-
#im_history(params = {}) ⇒ Object
Fetches history of messages and events from direct message channel.
-
#im_list(params = {}) ⇒ Object
Lists direct message channels for the calling user.
-
#im_mark(params = {}) ⇒ Object
Sets the read cursor in a direct message channel.
-
#im_open(params = {}) ⇒ Object
Opens a direct message channel.
Instance Method Details
#im_close(params = {}) ⇒ Object
Close a direct message channel.
20 21 22 23 24 |
# File 'lib/slack/web/im.rb', line 20 def im_close(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.close", params Slack.parse_response(response) end |
#im_history(params = {}) ⇒ Object
Fetches history of messages and events from direct message channel.
42 43 44 45 46 |
# File 'lib/slack/web/im.rb', line 42 def im_history(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.history", params Slack.parse_response(response) end |
#im_list(params = {}) ⇒ Object
Lists direct message channels for the calling user.
54 55 56 57 |
# File 'lib/slack/web/im.rb', line 54 def im_list(params = {}) response = @session.do_post "#{SCOPE}.list", params Slack.parse_response(response) end |
#im_mark(params = {}) ⇒ Object
Sets the read cursor in a direct message channel.
69 70 71 72 73 74 |
# File 'lib/slack/web/im.rb', line 69 def im_mark(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? fail ArgumentError, "Required arguments 'ts' missing" if params['ts'].nil? response = @session.do_post "#{SCOPE}.mark", params Slack.parse_response(response) end |
#im_open(params = {}) ⇒ Object
Opens a direct message channel.
84 85 86 87 88 |
# File 'lib/slack/web/im.rb', line 84 def im_open(params = {}) fail ArgumentError, "Required arguments 'user' missing" if params['user'].nil? response = @session.do_post "#{SCOPE}.open", params Slack.parse_response(response) end |