module Slack::Web::Api::Endpoints::Reactions

Public Instance Methods

reactions_add(options = {}) click to toggle source

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.

@option options [Object] :file_comment

File comment to add reaction to.

@option options [Object] :timestamp

Timestamp of the message to add reaction to.

@see api.slack.com/methods/reactions.add @see github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.add.json

# File lib/slack/web/api/endpoints/reactions.rb, line 23
def reactions_add(options = {})
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
  post('reactions.add', options)
end
reactions_get(options = {}) click to toggle source

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.

@option options [Object] :file_comment

File comment to get reactions for.

@option options [Object] :full

If true always return the complete reaction list.

@option options [Object] :timestamp

Timestamp of the message to get reactions for.

@see api.slack.com/methods/reactions.get @see github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.get.json

# File lib/slack/web/api/endpoints/reactions.rb, line 44
def reactions_get(options = {})
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
  post('reactions.get', options)
end
reactions_list(options = {}) click to toggle source

Lists reactions made by a user.

@option options [Object] :full

If true always return the complete reaction list.

@option options [user] :user

Show reactions made by this user. Defaults to the authed user.

@see api.slack.com/methods/reactions.list @see github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.list.json

# File lib/slack/web/api/endpoints/reactions.rb, line 58
def reactions_list(options = {})
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
  post('reactions.list', options)
end
reactions_remove(options = {}) click to toggle source

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.

@option options [file] :file

File to remove reaction from.

@option options [Object] :file_comment

File comment to remove reaction from.

@option options [Object] :timestamp

Timestamp of the message to remove reaction from.

@see api.slack.com/methods/reactions.remove @see github.com/slack-ruby/slack-api-ref/blob/master/methods/reactions/reactions.remove.json

# File lib/slack/web/api/endpoints/reactions.rb, line 78
def reactions_remove(options = {})
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
  post('reactions.remove', options)
end