lib/slack/web/api/endpoints/conversations.rb in slack-ruby-client-0.14.6 vs lib/slack/web/api/endpoints/conversations.rb in slack-ruby-client-0.15.0
- old
+ new
@@ -13,11 +13,11 @@
# ID of conversation to archive.
# @see https://api.slack.com/methods/conversations.archive
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
def conversations_archive(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.archive', options)
end
#
# Closes a direct message or multi-person direct message.
@@ -26,23 +26,21 @@
# Conversation to close.
# @see https://api.slack.com/methods/conversations.close
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.close.json
def conversations_close(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.close', options)
end
#
# Initiates a public or private channel-based conversation
#
# @option options [Object] :name
# Name of the public or private channel to create.
# @option options [Object] :is_private
# Create a private channel instead of a public one.
- # @option options [Object] :user_ids
- # Required for workspace apps. A list of between 1 and 30 human users that will be added to the newly-created conversation. This argument has no effect when used by classic Slack apps.
# @see https://api.slack.com/methods/conversations.create
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
def conversations_create(options = {})
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
post('conversations.create', options)
@@ -65,11 +63,11 @@
# Start of time range of messages to include in results.
# @see https://api.slack.com/methods/conversations.history
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
def conversations_history(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
if block_given?
Pagination::Cursor.new(self, :conversations_history, options).each do |page|
yield page
end
else
@@ -88,11 +86,11 @@
# Set to true to include the member count for the specified conversation. Defaults to false.
# @see https://api.slack.com/methods/conversations.info
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
def conversations_info(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.info', options)
end
#
# Invites users to a channel.
@@ -104,11 +102,11 @@
# @see https://api.slack.com/methods/conversations.invite
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
def conversations_invite(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.invite', options)
end
#
# Joins an existing conversation.
@@ -117,11 +115,11 @@
# ID of conversation to join.
# @see https://api.slack.com/methods/conversations.join
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
def conversations_join(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.join', options)
end
#
# Removes a user from a conversation.
@@ -133,11 +131,11 @@
# @see https://api.slack.com/methods/conversations.kick
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.kick.json
def conversations_kick(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
post('conversations.kick', options)
end
#
@@ -147,11 +145,11 @@
# Conversation to leave.
# @see https://api.slack.com/methods/conversations.leave
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
def conversations_leave(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.leave', options)
end
#
# Lists all channels in a Slack team.
@@ -187,11 +185,11 @@
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
# @see https://api.slack.com/methods/conversations.members
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
def conversations_members(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
if block_given?
Pagination::Cursor.new(self, :conversations_members, options).each do |page|
yield page
end
else
@@ -209,11 +207,11 @@
# @option options [Object] :users
# Comma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a channel when not supplying users.
# @see https://api.slack.com/methods/conversations.open
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
def conversations_open(options = {})
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.open', options)
end
#
# Renames a conversation.
@@ -225,11 +223,11 @@
# @see https://api.slack.com/methods/conversations.rename
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.rename.json
def conversations_rename(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.rename', options)
end
#
# Retrieve a thread of messages posted to a conversation
@@ -251,11 +249,11 @@
# @see https://api.slack.com/methods/conversations.replies
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.replies.json
def conversations_replies(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
if block_given?
Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
yield page
end
else
@@ -273,11 +271,11 @@
# @see https://api.slack.com/methods/conversations.setPurpose
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setPurpose.json
def conversations_setPurpose(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.setPurpose', options)
end
#
# Sets the topic for a conversation.
@@ -289,11 +287,11 @@
# @see https://api.slack.com/methods/conversations.setTopic
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setTopic.json
def conversations_setTopic(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.setTopic', options)
end
#
# Reverses conversation archival.
@@ -302,10 +300,10 @@
# ID of conversation to unarchive.
# @see https://api.slack.com/methods/conversations.unarchive
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
def conversations_unarchive(options = {})
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
post('conversations.unarchive', options)
end
end
end
end