Module: Slack::Web::Api::Endpoints::Groups
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/groups.rb
Instance Method Summary collapse
-
#groups_archive(options = {}) ⇒ Object
Archives a private channel.
-
#groups_create(options = {}) ⇒ Object
Creates a private channel.
-
#groups_createChild(options = {}) ⇒ Object
Clones and archives a private channel.
-
#groups_history(options = {}) ⇒ Object
Fetches history of messages and events from a private channel.
-
#groups_info(options = {}) ⇒ Object
Gets information about a private channel.
-
#groups_invite(options = {}) ⇒ Object
Invites a user to a private channel.
-
#groups_kick(options = {}) ⇒ Object
Removes a user from a private channel.
-
#groups_leave(options = {}) ⇒ Object
Leaves a private channel.
-
#groups_list(options = {}) ⇒ Object
Lists private channels that the calling user has access to.
-
#groups_mark(options = {}) ⇒ Object
Sets the read cursor in a private channel.
-
#groups_open(options = {}) ⇒ Object
Opens a private channel.
-
#groups_rename(options = {}) ⇒ Object
Renames a private channel.
-
#groups_replies(options = {}) ⇒ Object
Retrieve a thread of messages posted to a private channel.
-
#groups_setPurpose(options = {}) ⇒ Object
Sets the purpose for a private channel.
-
#groups_setTopic(options = {}) ⇒ Object
Sets the topic for a private channel.
-
#groups_unarchive(options = {}) ⇒ Object
Unarchives a private channel.
Instance Method Details
#groups_archive(options = {}) ⇒ Object
Archives a private channel.
15 16 17 18 19 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 15 def groups_archive( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.archive', ) end |
#groups_create(options = {}) ⇒ Object
Creates a private channel.
30 31 32 33 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 30 def groups_create( = {}) throw ArgumentError.new('Required arguments :name missing') if [:name].nil? post('groups.create', ) end |
#groups_createChild(options = {}) ⇒ Object
Clones and archives a private channel.
42 43 44 45 46 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 42 def groups_createChild( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.createChild', ) end |
#groups_history(options = {}) ⇒ Object
Fetches history of messages and events from a private channel.
63 64 65 66 67 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 63 def groups_history( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.history', ) end |
#groups_info(options = {}) ⇒ Object
Gets information about a private channel.
78 79 80 81 82 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 78 def groups_info( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.info', ) end |
#groups_invite(options = {}) ⇒ Object
Invites a user to a private channel.
93 94 95 96 97 98 99 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 93 def groups_invite( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :user missing') if [:user].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] = .merge(user: users_id()['user']['id']) if [:user] post('groups.invite', ) end |
#groups_kick(options = {}) ⇒ Object
Removes a user from a private channel.
110 111 112 113 114 115 116 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 110 def groups_kick( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :user missing') if [:user].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] = .merge(user: users_id()['user']['id']) if [:user] post('groups.kick', ) end |
#groups_leave(options = {}) ⇒ Object
Leaves a private channel.
125 126 127 128 129 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 125 def groups_leave( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.leave', ) end |
#groups_list(options = {}) ⇒ Object
Lists private channels that the calling user has access to.
140 141 142 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 140 def groups_list( = {}) post('groups.list', ) end |
#groups_mark(options = {}) ⇒ Object
Sets the read cursor in a private channel.
153 154 155 156 157 158 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 153 def groups_mark( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :ts missing') if [:ts].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.mark', ) end |
#groups_open(options = {}) ⇒ Object
Opens a private channel.
167 168 169 170 171 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 167 def groups_open( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.open', ) end |
#groups_rename(options = {}) ⇒ Object
Renames a private channel.
184 185 186 187 188 189 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 184 def groups_rename( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :name missing') if [:name].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.rename', ) end |
#groups_replies(options = {}) ⇒ Object
Retrieve a thread of messages posted to a private channel
200 201 202 203 204 205 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 200 def groups_replies( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :thread_ts missing') if [:thread_ts].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.replies', ) end |
#groups_setPurpose(options = {}) ⇒ Object
Sets the purpose for a private channel.
216 217 218 219 220 221 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 216 def groups_setPurpose( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :purpose missing') if [:purpose].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.setPurpose', ) end |
#groups_setTopic(options = {}) ⇒ Object
Sets the topic for a private channel.
232 233 234 235 236 237 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 232 def groups_setTopic( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :topic missing') if [:topic].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.setTopic', ) end |
#groups_unarchive(options = {}) ⇒ Object
Unarchives a private channel.
246 247 248 249 250 |
# File 'lib/slack/web/api/endpoints/groups.rb', line 246 def groups_unarchive( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: groups_id()['group']['id']) if [:channel] post('groups.unarchive', ) end |