lib/slack/web/api/endpoints/conversations.rb in slack-ruby-client-0.15.1 vs lib/slack/web/api/endpoints/conversations.rb in slack-ruby-client-0.16.0
- old
+ new
@@ -37,10 +37,12 @@
#
# @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] :team_id
+ # encoded team id to create the channel in, required if org token is used.
# @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)
@@ -158,10 +160,12 @@
# Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
# @option options [Object] :exclude_archived
# Set to true to exclude archived channels from the list.
# @option options [Object] :limit
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000.
+ # @option options [Object] :team_id
+ # encoded team id to list channels in, required if org token is used.
# @option options [Object] :types
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
# @see https://api.slack.com/methods/conversations.list
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.list.json
def conversations_list(options = {})
@@ -173,10 +177,26 @@
post('conversations.list', options)
end
end
#
+ # Sets the read cursor in a channel.
+ #
+ # @option options [channel] :channel
+ # Channel or conversation to set the read cursor for.
+ # @option options [timestamp] :ts
+ # Unique identifier of message you want marked as most recently seen in this conversation.
+ # @see https://api.slack.com/methods/conversations.mark
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.mark.json
+ def conversations_mark(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: conversations_id(options)['channel']['id']) if options[:channel]
+ post('conversations.mark', options)
+ end
+
+ #
# Retrieve members of a conversation.
#
# @option options [channel] :channel
# ID of the conversation to retrieve members for.
# @option options [Object] :cursor
@@ -233,10 +253,10 @@
# Retrieve a thread of messages posted to a conversation
#
# @option options [channel] :channel
# Conversation ID to fetch thread from.
# @option options [timestamp] :ts
- # Unique identifier of a thread's parent message.
+ # Unique identifier of a thread's parent message. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message.
# @option options [Object] :cursor
# Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
# @option options [Object] :inclusive
# Include messages with latest or oldest timestamp in results only when either timestamp is specified.
# @option options [timestamp] :latest