Module: Slack::Web::Reactions

Defined in:
lib/slack/web/reactions.rb

Overview

Module for the ractions methods.

Constant Summary collapse

SCOPE =

Endpoint scope

'reactions'

Instance Method Summary collapse

Instance Method Details

#reactions_add(params = {}) ⇒ Object

This method adds a reaction (emoji) to an item (file, file comment, channel message, group message, or direct message).

Parameters:

  • params (Hash) (defaults to: {})

    API call arguments

Options Hash (params):

  • 'name' (Object)

    Reaction (emoji) name.

  • 'file' (Object)

    File to add reaction to.

  • 'file_comment' (Object)

    File comment to add reaction to.

  • 'channel' (Object)

    Channel where the message to add reaction to was posted.

  • 'timestamp' (Object)

    Timestamp of the message to add reaction to.

See Also:



25
26
27
28
29
# File 'lib/slack/web/reactions.rb', line 25

def reactions_add(params = {})
  fail ArgumentError, "Required arguments 'name' missing" if params['name'].nil?
  response = @session.do_post "#{SCOPE}.add", params
  Slack.parse_response(response)
end

#reactions_get(params = {}) ⇒ Object

This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message).

Parameters:

  • params (Hash) (defaults to: {})

    API call arguments

Options Hash (params):

  • 'file' (Object)

    File to get reactions for.

  • 'file_comment' (Object)

    File comment to get reactions for.

  • 'channel' (Object)

    Channel where the message to get reactions for was posted.

  • 'timestamp' (Object)

    Timestamp of the message to get reactions for.

  • 'full' (Object)

    If true always return the complete reaction list.

See Also:



48
49
50
51
# File 'lib/slack/web/reactions.rb', line 48

def reactions_get(params = {})
  response = @session.do_post "#{SCOPE}.add", params
  Slack.parse_response(response)
end

#reactions_list(params = {}) ⇒ Object

This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user.

Parameters:

  • params (Hash) (defaults to: {})

    API call arguments

Options Hash (params):

  • 'user' (Object)

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

  • 'full' (Object)

    If true always return the complete reaction list.

  • 'count' (Object)

    Number of items to return per page.

  • 'page' (Object)

    Page number of results to return.

See Also:



68
69
70
71
# File 'lib/slack/web/reactions.rb', line 68

def reactions_list(params = {})
  response = @session.do_post "#{SCOPE}.list", params
  Slack.parse_response(response)
end

#reactions_remove(params = {}) ⇒ Object

This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message)

Parameters:

  • params (Hash) (defaults to: {})

    API call arguments

Options Hash (params):

  • 'name' (Object)

    Reaction (emoji) name.

  • 'file' (Object)

    File to remove reaction from.

  • 'file_comment' (Object)

    File comment to remove reaction from.

  • 'channel' (Object)

    Channel where the message to remove reaction from was posted.

  • 'timestamp' (Object)

    Timestamp of the message to remove reaction from.

See Also:



90
91
92
93
94
# File 'lib/slack/web/reactions.rb', line 90

def reactions_remove(params = {})
  fail ArgumentError, "Required arguments 'name' missing" if params['name'].nil?
  response = @session.do_post "#{SCOPE}.remove", params
  Slack.parse_response(response)
end