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_acceptSharedInvite(options = {}) ⇒ Object
Accepts an invitation to a Slack Connect channel.
-
#conversations_approveSharedInvite(options = {}) ⇒ Object
Approves an invitation to a Slack Connect channel.
-
#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_declineSharedInvite(options = {}) ⇒ Object
Declines a Slack Connect channel invite.
-
#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_inviteShared(options = {}) ⇒ Object
Sends an invitation to a Slack Connect 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_listConnectInvites(options = {}) ⇒ Object
Lists shared channel invites that have been generated or received but have not been approved by all parties.
-
#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_acceptSharedInvite(options = {}) ⇒ Object
Accepts an invitation to a Slack Connect channel.
26 27 28 29 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 26 def conversations_acceptSharedInvite( = {}) throw ArgumentError.new('Required arguments :channel_name missing') if [:channel_name].nil? post('conversations.acceptSharedInvite', ) end |
#conversations_approveSharedInvite(options = {}) ⇒ Object
Approves an invitation to a Slack Connect channel
40 41 42 43 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 40 def conversations_approveSharedInvite( = {}) throw ArgumentError.new('Required arguments :invite_id missing') if [:invite_id].nil? post('conversations.approveSharedInvite', ) end |
#conversations_archive(options = {}) ⇒ Object
Archives a conversation.
52 53 54 55 56 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 52 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.
65 66 67 68 69 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 65 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
82 83 84 85 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 82 def conversations_create( = {}) throw ArgumentError.new('Required arguments :name missing') if [:name].nil? post('conversations.create', ) end |
#conversations_declineSharedInvite(options = {}) ⇒ Object
Declines a Slack Connect channel invite.
96 97 98 99 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 96 def conversations_declineSharedInvite( = {}) throw ArgumentError.new('Required arguments :invite_id missing') if [:invite_id].nil? post('conversations.declineSharedInvite', ) end |
#conversations_history(options = {}) ⇒ Object
Fetches a conversation’s history of messages and events.
118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 118 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.
141 142 143 144 145 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 141 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.
156 157 158 159 160 161 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 156 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_inviteShared(options = {}) ⇒ Object
Sends an invitation to a Slack Connect channel
176 177 178 179 180 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 176 def conversations_inviteShared( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.inviteShared', ) end |
#conversations_join(options = {}) ⇒ Object
Joins an existing conversation.
189 190 191 192 193 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 189 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.
204 205 206 207 208 209 210 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 204 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.
219 220 221 222 223 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 219 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.
240 241 242 243 244 245 246 247 248 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 240 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_listConnectInvites(options = {}) ⇒ Object
Lists shared channel invites that have been generated or received but have not been approved by all parties
259 260 261 262 263 264 265 266 267 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 259 def conversations_listConnectInvites( = {}) if block_given? Pagination::Cursor.new(self, :conversations_listConnectInvites, ).each do |page| yield page end else post('conversations.listConnectInvites', ) end end |
#conversations_mark(options = {}) ⇒ Object
Sets the read cursor in a channel.
278 279 280 281 282 283 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 278 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.
296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 296 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.
321 322 323 324 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 321 def conversations_open( = {}) = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.open', ) end |
#conversations_rename(options = {}) ⇒ Object
Renames a conversation.
335 336 337 338 339 340 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 335 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
361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 361 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.
383 384 385 386 387 388 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 383 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.
399 400 401 402 403 404 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 399 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.
413 414 415 416 417 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 413 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 |