Module: Slack::Endpoint::Stars

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

Instance Method Summary collapse

Instance Method Details

#stars_add(options = {}) ⇒ Object

This method adds a star to an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. One of file, file_comment, channel, or the combination of channel and timestamp must be specified.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :file (Object)

    File to add star to.

  • :file_comment (Object)

    File comment to add star to.

  • :channel (Object)

    Channel to add star to, or channel where the message to add star to was posted (used with timestamp).

  • :timestamp (Object)

    Timestamp of the message to add star to.

See Also:



21
22
23
24
# File 'lib/slack/endpoint/stars.rb', line 21

def stars_add(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("stars.add", options)
end

#stars_list(options = {}) ⇒ Object

This method lists the items starred by the authed user.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :count (Object)

    Number of items to return per page.

  • :page (Object)

    Page number of results to return.

See Also:



36
37
38
39
# File 'lib/slack/endpoint/stars.rb', line 36

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

#stars_remove(options = {}) ⇒ Object

This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. One of file, file_comment, channel, or the combination of channel and timestamp must be specified.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :file (Object)

    File to remove star from.

  • :file_comment (Object)

    File comment to remove star from.

  • :channel (Object)

    Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).

  • :timestamp (Object)

    Timestamp of the message to remove star from.

See Also:



56
57
58
59
# File 'lib/slack/endpoint/stars.rb', line 56

def stars_remove(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("stars.remove", options)
end