Module: Slack::Web::Groups
- Included in:
- Slack::Web
- Defined in:
- lib/slack/web/groups.rb
Overview
Module for the groups methods. Get info on your team's private groups.
Constant Summary collapse
- SCOPE =
Endpoint 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_info(params = {}) ⇒ Object
This method returns information about 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.
20 21 22 23 24 |
# File 'lib/slack/web/groups.rb', line 20 def groups_archive(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.archive", params Slack.parse_response(response) end |
#groups_close(params = {}) ⇒ Object
Closes a private group.
34 35 36 37 38 |
# File 'lib/slack/web/groups.rb', line 34 def groups_close(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.close", params Slack.parse_response(response) end |
#groups_create(params = {}) ⇒ Object
Creates a private group.
48 49 50 51 52 |
# File 'lib/slack/web/groups.rb', line 48 def groups_create(params = {}) fail ArgumentError, "Required arguments 'name' missing" if params['name'].nil? response = @session.do_post "#{SCOPE}.create", params Slack.parse_response(response) end |
#groups_create_child(params = {}) ⇒ Object
Clones and archives a private group.
62 63 64 65 66 |
# File 'lib/slack/web/groups.rb', line 62 def groups_create_child(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.createChild", params Slack.parse_response(response) end |
#groups_history(params = {}) ⇒ Object
Fetches history of messages and events from a private group.
84 85 86 87 88 |
# File 'lib/slack/web/groups.rb', line 84 def groups_history(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.history", params Slack.parse_response(response) end |
#groups_info(params = {}) ⇒ Object
This method returns information about a private group.
98 99 100 101 102 |
# File 'lib/slack/web/groups.rb', line 98 def groups_info(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.info", params Slack.parse_response(response) end |
#groups_invite(params = {}) ⇒ Object
Invites a user to a private group.
114 115 116 117 118 119 |
# File 'lib/slack/web/groups.rb', line 114 def groups_invite(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? fail ArgumentError, "Required arguments 'user' missing" if params['user'].nil? response = @session.do_post "#{SCOPE}.invite", params Slack.parse_response(response) end |
#groups_kick(params = {}) ⇒ Object
Removes a user from a private group.
131 132 133 134 135 136 |
# File 'lib/slack/web/groups.rb', line 131 def groups_kick(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? fail ArgumentError, "Required arguments 'user' missing" if params['user'].nil? response = @session.do_post "#{SCOPE}.kick", params Slack.parse_response(response) end |
#groups_leave(params = {}) ⇒ Object
Leaves a private group.
145 146 147 148 149 |
# File 'lib/slack/web/groups.rb', line 145 def groups_leave(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.leave", params Slack.parse_response(response) end |
#groups_list(params = {}) ⇒ Object
Lists private groups that the calling user has access to.
159 160 161 162 |
# File 'lib/slack/web/groups.rb', line 159 def groups_list(params = {}) response = @session.do_post "#{SCOPE}.list", params Slack.parse_response(response) end |
#groups_mark(params = {}) ⇒ Object
Sets the read cursor in a private group.
174 175 176 177 178 179 |
# File 'lib/slack/web/groups.rb', line 174 def groups_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 |
#groups_open(params = {}) ⇒ Object
Opens a private group.
189 190 191 192 193 |
# File 'lib/slack/web/groups.rb', line 189 def groups_open(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.open", params Slack.parse_response(response) end |
#groups_rename(params = {}) ⇒ Object
Renames a private group.
205 206 207 208 209 210 |
# File 'lib/slack/web/groups.rb', line 205 def groups_rename(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? fail ArgumentError, "Required arguments 'name' missing" if params['name'].nil? response = @session.do_post "#{SCOPE}.rename", params Slack.parse_response(response) end |
#groups_set_purpose(params = {}) ⇒ Object
Sets the purpose for a private group.
222 223 224 225 226 227 |
# File 'lib/slack/web/groups.rb', line 222 def groups_set_purpose(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? fail ArgumentError, "Required arguments 'pupose' missing" if params['purpos'].nil? response = @session.do_post "#{SCOPE}.setPurpose", params Slack.parse_response(response) end |
#groups_set_topic(params = {}) ⇒ Object
Sets the topic for a private group.
239 240 241 242 243 244 |
# File 'lib/slack/web/groups.rb', line 239 def groups_set_topic(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? fail ArgumentError, "Required arguments 'topic' missing" if params['topic'].nil? response = @session.do_post "#{SCOPE}.setTopic", params Slack.parse_response(response) end |
#groups_unarchive(params = {}) ⇒ Object
Unarchives a private group.
254 255 256 257 258 |
# File 'lib/slack/web/groups.rb', line 254 def groups_unarchive(params = {}) fail ArgumentError, "Required arguments 'channel' missing" if params['channel'].nil? response = @session.do_post "#{SCOPE}.unarchive", params Slack.parse_response(response) end |