Module: Slack::Web::Groups
- Included in:
- Slack::Web
- Defined in:
- lib/slack/web/groups.rb
Constant Summary collapse
- SCOPE =
"groups"
Instance Method Summary collapse
-
#groups_archive(params = {}) ⇒ Object
Archives a private group.
-
#groups_close(params = {}) ⇒ Object
Closes a private group.
-
#groups_create(params = {}) ⇒ Object
Creates a private group.
-
#groups_create_child(params = {}) ⇒ Object
Clones and archives a private group.
-
#groups_history(params = {}) ⇒ Object
Fetches history of messages and events from a private group.
-
#groups_invite(params = {}) ⇒ Object
Invites a user to a private group.
-
#groups_kick(params = {}) ⇒ Object
Removes a user from a private group.
-
#groups_leave(params = {}) ⇒ Object
Leaves a private group.
-
#groups_list(params = {}) ⇒ Object
Lists private groups that the calling user has access to..
-
#groups_mark(params = {}) ⇒ Object
Sets the read cursor in a private group.
-
#groups_open(params = {}) ⇒ Object
Opens a private group.
-
#groups_rename(params = {}) ⇒ Object
Renames a private group.
-
#groups_set_purpose(params = {}) ⇒ Object
Sets the purpose for a private group.
-
#groups_set_topic(params = {}) ⇒ Object
Sets the topic for a private group.
-
#groups_unarchive(params = {}) ⇒ Object
Unarchives a private group.
Instance Method Details
#groups_archive(params = {}) ⇒ Object
Archives a private group.
7 8 9 10 11 |
# File 'lib/slack/web/groups.rb', line 7 def groups_archive(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.archive", params Slack::parse_response(response) end |
#groups_close(params = {}) ⇒ Object
Closes a private group.
14 15 16 17 18 |
# File 'lib/slack/web/groups.rb', line 14 def groups_close(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.close", params Slack::parse_response(response) end |
#groups_create(params = {}) ⇒ Object
Creates a private group.
21 22 23 24 25 |
# File 'lib/slack/web/groups.rb', line 21 def groups_create(params={}) throw ArgumentError.new("Required arguments :name missing") if params['name'].nil? response = @session.do_get "#{SCOPE}.create", params Slack::parse_response(response) end |
#groups_create_child(params = {}) ⇒ Object
Clones and archives a private group.
28 29 30 31 32 |
# File 'lib/slack/web/groups.rb', line 28 def groups_create_child(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.createChild", params Slack::parse_response(response) end |
#groups_history(params = {}) ⇒ Object
Fetches history of messages and events from a private group.
35 36 37 38 39 |
# File 'lib/slack/web/groups.rb', line 35 def groups_history(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.history", params Slack::parse_response(response) end |
#groups_invite(params = {}) ⇒ Object
Invites a user to a private group.
42 43 44 45 46 47 |
# File 'lib/slack/web/groups.rb', line 42 def groups_invite(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? throw ArgumentError.new("Required arguments :user missing") if params['user'].nil? response = @session.do_get "#{SCOPE}.invite", params Slack::parse_response(response) end |
#groups_kick(params = {}) ⇒ Object
Removes a user from a private group.
50 51 52 53 54 55 |
# File 'lib/slack/web/groups.rb', line 50 def groups_kick(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? throw ArgumentError.new("Required arguments :user missing") if params['user'].nil? response = @session.do_get "#{SCOPE}.kick", params Slack::parse_response(response) end |
#groups_leave(params = {}) ⇒ Object
Leaves a private group.
58 59 60 61 62 |
# File 'lib/slack/web/groups.rb', line 58 def groups_leave(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.leave", params Slack::parse_response(response) end |
#groups_list(params = {}) ⇒ Object
Lists private groups that the calling user has access to..
65 66 67 68 |
# File 'lib/slack/web/groups.rb', line 65 def groups_list(params={}) response = @session.do_get "#{SCOPE}.list", params Slack::parse_response(response) end |
#groups_mark(params = {}) ⇒ Object
Sets the read cursor in a private group.
71 72 73 74 75 76 |
# File 'lib/slack/web/groups.rb', line 71 def groups_mark(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? throw ArgumentError.new("Required arguments :ts missing") if params['ts'].nil? response = @session.do_get "#{SCOPE}.mark", params Slack::parse_response(response) end |
#groups_open(params = {}) ⇒ Object
Opens a private group.
79 80 81 82 83 |
# File 'lib/slack/web/groups.rb', line 79 def groups_open(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.open", params Slack::parse_response(response) end |
#groups_rename(params = {}) ⇒ Object
Renames a private group.
86 87 88 89 90 91 |
# File 'lib/slack/web/groups.rb', line 86 def groups_rename(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? throw ArgumentError.new("Required arguments :name missing") if params['name'].nil? response = @session.do_get "#{SCOPE}.rename", params Slack::parse_response(response) end |
#groups_set_purpose(params = {}) ⇒ Object
Sets the purpose for a private group.
94 95 96 97 98 99 |
# File 'lib/slack/web/groups.rb', line 94 def groups_set_purpose(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? throw ArgumentError.new("Required arguments :pupose missing") if params['purpos'].nil? response = @session.do_get "#{SCOPE}.setPurpose", params Slack::parse_response(response) end |
#groups_set_topic(params = {}) ⇒ Object
Sets the topic for a private group.
102 103 104 105 106 107 |
# File 'lib/slack/web/groups.rb', line 102 def groups_set_topic(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? throw ArgumentError.new("Required arguments :topic missing") if params['topic'].nil? response = @session.do_get "#{SCOPE}.setTopic", params Slack::parse_response(response) end |
#groups_unarchive(params = {}) ⇒ Object
Unarchives a private group.
110 111 112 113 114 |
# File 'lib/slack/web/groups.rb', line 110 def groups_unarchive(params={}) throw ArgumentError.new("Required arguments :channel missing") if params['channel'].nil? response = @session.do_get "#{SCOPE}.unarchive", params Slack::parse_response(response) end |