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.
158 159 160 161 162 163 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 158 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
178 179 180 181 182 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 178 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.
191 192 193 194 195 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 191 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.
206 207 208 209 210 211 212 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 206 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.
221 222 223 224 225 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 221 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.
242 243 244 245 246 247 248 249 250 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 242 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
261 262 263 264 265 266 267 268 269 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 261 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.
280 281 282 283 284 285 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 280 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.
298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 298 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.
323 324 325 326 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 323 def conversations_open( = {}) = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.open', ) end |
#conversations_rename(options = {}) ⇒ Object
Renames a conversation.
337 338 339 340 341 342 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 337 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
365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 365 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.
387 388 389 390 391 392 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 387 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.
403 404 405 406 407 408 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 403 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.
417 418 419 420 421 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 417 def conversations_unarchive( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('conversations.unarchive', ) end |