Module: Slack::Web::Api::Endpoints::Stars

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/stars.rb

Instance Method Summary collapse

Instance Method Details

#stars_add(options = {}) ⇒ Object

Adds a star to an item.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (channel)

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

  • :file (file)

    File to add star to.

  • :file_comment (Object)

    File comment to add star to.

  • :timestamp (Object)

    Timestamp of the message to add star to.

See Also:



21
22
23
24
# File 'lib/slack/web/api/endpoints/stars.rb', line 21

def stars_add(options = {})
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
  post('stars.add', options)
end

#stars_list(options = {}) ⇒ Object

Lists stars for a user.



31
32
33
# File 'lib/slack/web/api/endpoints/stars.rb', line 31

def stars_list(options = {})
  post('stars.list', options)
end

#stars_remove(options = {}) ⇒ Object

Removes a star from an item.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel (channel)

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

  • :file (file)

    File to remove star from.

  • :file_comment (Object)

    File comment to remove star from.

  • :timestamp (Object)

    Timestamp of the message to remove star from.

See Also:



48
49
50
51
# File 'lib/slack/web/api/endpoints/stars.rb', line 48

def stars_remove(options = {})
  options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
  post('stars.remove', options)
end