Module: Slack::Endpoint::Reactions

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/reactions.rb

Instance Method Summary collapse

Instance Method Details

#reactions_add(options = {}) ⇒ Object

This method adds a reaction (emoji) to 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.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :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:



23
24
25
26
27
# File 'lib/slack/endpoint/reactions.rb', line 23

def reactions_add(options={})
  throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reactions.add", options)
end

#reactions_get(options = {}) ⇒ Object

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :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:



45
46
47
48
# File 'lib/slack/endpoint/reactions.rb', line 45

def reactions_get(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reactions.get", options)
end

#reactions_list(options = {}) ⇒ 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:

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

    a customizable set of options

Options Hash (options):

  • :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:



64
65
66
67
# File 'lib/slack/endpoint/reactions.rb', line 64

def reactions_list(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reactions.list", options)
end

#reactions_remove(options = {}) ⇒ Object

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.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :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:



86
87
88
89
90
# File 'lib/slack/endpoint/reactions.rb', line 86

def reactions_remove(options={})
  throw ArgumentError.new("Required arguments :name missing") if options[:name].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reactions.remove", options)
end