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( = {}) raise ArgumentError, '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( = {}) raise ArgumentError, '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( = {}) raise ArgumentError, '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( = {}) raise ArgumentError, '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( = {}) raise ArgumentError, '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( = {}) raise ArgumentError, '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.
120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 120 def conversations_history( = {}) raise ArgumentError, '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.
143 144 145 146 147 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 143 def conversations_info( = {}) raise ArgumentError, '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.
160 161 162 163 164 165 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 160 def conversations_invite( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, '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
180 181 182 183 184 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 180 def conversations_inviteShared( = {}) raise ArgumentError, '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.
193 194 195 196 197 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 193 def conversations_join( = {}) raise ArgumentError, '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.
208 209 210 211 212 213 214 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 208 def conversations_kick( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, '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.
223 224 225 226 227 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 223 def conversations_leave( = {}) raise ArgumentError, '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.
244 245 246 247 248 249 250 251 252 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 244 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
263 264 265 266 267 268 269 270 271 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 263 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.
282 283 284 285 286 287 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 282 def conversations_mark( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, '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.
300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 300 def conversations_members( = {}) raise ArgumentError, '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.
325 326 327 328 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 325 def conversations_open( = {}) = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.open', ) end |
#conversations_rename(options = {}) ⇒ Object
Renames a conversation.
339 340 341 342 343 344 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 339 def conversations_rename( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, '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
367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 367 def conversations_replies( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, '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.
389 390 391 392 393 394 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 389 def conversations_setPurpose( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, '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.
405 406 407 408 409 410 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 405 def conversations_setTopic( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, '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.
419 420 421 422 423 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 419 def conversations_unarchive( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.unarchive', ) end |