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_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.
15 16 17 18 19 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 15 def conversations_archive( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('conversations.archive', ) end |
#conversations_close(options = {}) ⇒ Object
Closes a direct message or multi-person direct message.
28 29 30 31 32 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 28 def conversations_close( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('conversations.close', ) end |
#conversations_create(options = {}) ⇒ Object
Initiates a public or private channel-based conversation
45 46 47 48 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 45 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.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 67 def conversations_history( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_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.
88 89 90 91 92 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 88 def conversations_info( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('conversations.info', ) end |
#conversations_invite(options = {}) ⇒ Object
Invites users to a channel.
103 104 105 106 107 108 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 103 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: channels_id()['channel']['id']) if [:channel] post('conversations.invite', ) end |
#conversations_join(options = {}) ⇒ Object
Joins an existing conversation.
117 118 119 120 121 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 117 def conversations_join( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('conversations.join', ) end |
#conversations_kick(options = {}) ⇒ Object
Removes a user from a conversation.
132 133 134 135 136 137 138 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 132 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: channels_id()['channel']['id']) if [:channel] = .merge(user: users_id()['user']['id']) if [:user] post('conversations.kick', ) end |
#conversations_leave(options = {}) ⇒ Object
Leaves a conversation.
147 148 149 150 151 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 147 def conversations_leave( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('conversations.leave', ) end |
#conversations_list(options = {}) ⇒ Object
Lists all channels in a Slack team.
166 167 168 169 170 171 172 173 174 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 166 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_members(options = {}) ⇒ Object
Retrieve members of a conversation.
187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 187 def conversations_members( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_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.
210 211 212 213 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 210 def conversations_open( = {}) = .merge(channel: channels_id()['channel']['id']) if [:channel] post('conversations.open', ) end |
#conversations_rename(options = {}) ⇒ Object
Renames a conversation.
224 225 226 227 228 229 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 224 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: channels_id()['channel']['id']) if [:channel] post('conversations.rename', ) end |
#conversations_replies(options = {}) ⇒ Object
Retrieve a thread of messages posted to a conversation
250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 250 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: channels_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.
272 273 274 275 276 277 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 272 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: channels_id()['channel']['id']) if [:channel] post('conversations.setPurpose', ) end |
#conversations_setTopic(options = {}) ⇒ Object
Sets the topic for a conversation.
288 289 290 291 292 293 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 288 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: channels_id()['channel']['id']) if [:channel] post('conversations.setTopic', ) end |
#conversations_unarchive(options = {}) ⇒ Object
Reverses conversation archival.
302 303 304 305 306 |
# File 'lib/slack/web/api/endpoints/conversations.rb', line 302 def conversations_unarchive( = {}) throw ArgumentError.new('Required arguments :channel missing') if [:channel].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('conversations.unarchive', ) end |