lib/slack/web/api/endpoints/reactions.rb in slack-ruby-client-0.11.1 vs lib/slack/web/api/endpoints/reactions.rb in slack-ruby-client-0.12.0

- old
+ new

@@ -47,18 +47,28 @@ end # # Lists reactions made by a user. # + # @option options [Object] :cursor + # Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See pagination for more details. # @option options [Object] :full # If true always return the complete reaction 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. # @option options [user] :user # Show reactions made by this user. Defaults to the authed user. # @see https://api.slack.com/methods/reactions.list # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.list.json def reactions_list(options = {}) options = options.merge(user: users_id(options)['user']['id']) if options[:user] - post('reactions.list', options) + if block_given? + Pagination::Cursor.new(self, :reactions_list, options).each do |page| + yield page + end + else + post('reactions.list', options) + end end # # Removes a reaction from an item. #