Module: Slack::Web::Api::Endpoints::Conversations
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/conversations.rb
Instance Method Summary collapse
-
#conversations_archive(options = {}) ⇒ Object
Archives a conversation.
-
#conversations_close(options = {}) ⇒ Object
Closes a direct message or multi-person direct message.
-
#conversations_create(options = {}) ⇒ Object
Initiates a public or private channel-based conversation.
-
#conversations_history(options = {}) ⇒ Object
Fetches a conversation’s history of messages and events.
-
#conversations_info(options = {}) ⇒ Object
Retrieve information about a conversation.
-
#conversations_invite(options = {}) ⇒ Object
Invites users to a channel.
-
#conversations_join(options = {}) ⇒ Object
Joins an existing conversation.
-
#conversations_kick(options = {}) ⇒ Object
Removes a user from a conversation.
-
#conversations_leave(options = {}) ⇒ Object
Leaves a conversation.
-
#conversations_list(options = {}) ⇒ Object
Lists all channels in a Slack team.
-
#conversations_mark(options = {}) ⇒ Object
Sets the read cursor in a channel.
-
#conversations_members(options = {}) ⇒ Object
Retrieve members of a conversation.
-
#conversations_open(options = {}) ⇒ Object
Opens or resumes a direct message or multi-person direct message.
-
#conversations_rename(options = {}) ⇒ Object
Renames a conversation.
-
#conversations_replies(options = {}) ⇒ Object
Retrieve a thread of messages posted to a conversation.
-
#conversations_setPurpose(options = {}) ⇒ Object
Sets the purpose for a conversation.
-
#conversations_setTopic(options = {}) ⇒ Object
Sets the topic for a conversation.
-
#conversations_unarchive(options = {}) ⇒ Object
Reverses conversation archival.
Instance Method Details
#conversations_archive(options = {}) ⇒ Object
Archives a conversation.
16 17 18 19 20 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 16 def conversations_archive( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.archive', ) end |
#conversations_close(options = {}) ⇒ Object
Closes a direct message or multi-person direct message.
29 30 31 32 33 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 29 def conversations_close( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.close', ) end |
#conversations_create(options = {}) ⇒ Object
Initiates a public or private channel-based conversation
46 47 48 49 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 46 def conversations_create( = {}) throw ArgumentError.new('Required arguments :name missing') if [:name].nil? post('conversations.create', ) end |
#conversations_history(options = {}) ⇒ Object
Fetches a conversation’s history of messages and events.
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 68 def conversations_history( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] if block_given? Pagination::Cursor.new(self, :conversations_history, ).each do |page| yield page end else post('conversations.history', ) end end |
#conversations_info(options = {}) ⇒ Object
Retrieve information about a conversation.
91 92 93 94 95 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 91 def conversations_info( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.info', ) end |
#conversations_invite(options = {}) ⇒ Object
Invites users to a channel.
106 107 108 109 110 111 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 106 def conversations_invite( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :users missing') if [:users].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.invite', ) end |
#conversations_join(options = {}) ⇒ Object
Joins an existing conversation.
120 121 122 123 124 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 120 def conversations_join( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.join', ) end |
#conversations_kick(options = {}) ⇒ Object
Removes a user from a conversation.
135 136 137 138 139 140 141 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 135 def conversations_kick( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :user missing') if [:user].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] = .merge(user: users_id()['user']['id']) if [:user] post('conversations.kick', ) end |
#conversations_leave(options = {}) ⇒ Object
Leaves a conversation.
150 151 152 153 154 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 150 def conversations_leave( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.leave', ) end |
#conversations_list(options = {}) ⇒ Object
Lists all channels in a Slack team.
171 172 173 174 175 176 177 178 179 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 171 def conversations_list( = {}) if block_given? Pagination::Cursor.new(self, :conversations_list, ).each do |page| yield page end else post('conversations.list', ) end end |
#conversations_mark(options = {}) ⇒ Object
Sets the read cursor in a channel.
190 191 192 193 194 195 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 190 def conversations_mark( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :ts missing') if [:ts].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.mark', ) end |
#conversations_members(options = {}) ⇒ Object
Retrieve members of a conversation.
208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 208 def conversations_members( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] if block_given? Pagination::Cursor.new(self, :conversations_members, ).each do |page| yield page end else post('conversations.members', ) end end |
#conversations_open(options = {}) ⇒ Object
Opens or resumes a direct message or multi-person direct message.
231 232 233 234 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 231 def conversations_open( = {}) = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.open', ) end |
#conversations_rename(options = {}) ⇒ Object
Renames a conversation.
245 246 247 248 249 250 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 245 def conversations_rename( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :name missing') if [:name].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.rename', ) end |
#conversations_replies(options = {}) ⇒ Object
Retrieve a thread of messages posted to a conversation
271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 271 def conversations_replies( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :ts missing') if [:ts].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] if block_given? Pagination::Cursor.new(self, :conversations_replies, ).each do |page| yield page end else post('conversations.replies', ) end end |
#conversations_setPurpose(options = {}) ⇒ Object
Sets the purpose for a conversation.
293 294 295 296 297 298 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 293 def conversations_setPurpose( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :purpose missing') if [:purpose].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.setPurpose', ) end |
#conversations_setTopic(options = {}) ⇒ Object
Sets the topic for a conversation.
309 310 311 312 313 314 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 309 def conversations_setTopic( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? throw ArgumentError.new('Required arguments :topic missing') if [:topic].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.setTopic', ) end |
#conversations_unarchive(options = {}) ⇒ Object
Reverses conversation archival.
323 324 325 326 327 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 323 def conversations_unarchive( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.unarchive', ) end |