lib/slack/web/api/endpoints/reactions.rb in slack-ruby-client-0.14.4 vs lib/slack/web/api/endpoints/reactions.rb in slack-ruby-client-0.14.5

- old
+ new

@@ -1,36 +1,34 @@ +# frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake module Slack module Web module Api module Endpoints module Reactions # - # This method adds a reaction (emoji) to a message. - # Now that file threads work the way you'd expect, the file and file_comment arguments are deprecated. Specify channel and timestamp instead. + # Adds a reaction to an item. # - # @option options [Object] :name - # Reaction (emoji) name. # @option options [channel] :channel # Channel where the message to add reaction to was posted. - # @option options [file] :file - # File to add reaction to. Now that file threads work the way you'd expect, this argument is deprecated. Specify the timestamp and channel of the message associated with a file instead. - # @option options [Object] :file_comment - # File comment to add reaction to. Now that file threads work the way you'd expect, this argument is deprecated. Specify the timestamp and channel of the message associated with a file instead. + # @option options [Object] :name + # Reaction (emoji) name. # @option options [Object] :timestamp # Timestamp of the message to add reaction to. # @see https://api.slack.com/methods/reactions.add # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.add.json def reactions_add(options = {}) + throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil? throw ArgumentError.new('Required arguments :name missing') if options[:name].nil? + throw ArgumentError.new('Required arguments :timestamp missing') if options[:timestamp].nil? options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] post('reactions.add', options) end # - # This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message). + # Gets reactions for an item. # # @option options [channel] :channel # Channel where the message to get reactions for was posted. # @option options [file] :file # File to get reactions for. @@ -46,11 +44,11 @@ options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel] post('reactions.get', options) end # - # This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user. + # 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. @@ -70,11 +68,10 @@ post('reactions.list', options) end end # - # This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message). - # One of file, file_comment, or the combination of channel and timestamp must be specified. + # Removes a reaction from an item. # # @option options [Object] :name # Reaction (emoji) name. # @option options [channel] :channel # Channel where the message to remove reaction from was posted.