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

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 (file)

    File to add star to.

  • :file_comment (Object)

    File comment to add star to.

  • :channel (channel)

    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:



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

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

This method lists the items starred by a user.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :user (user)

    Show stars by this user. Defaults to the authed user.

See Also:



34
35
36
37
# File 'lib/slack/web/api/endpoints/stars.rb', line 34

def stars_list(options = {})
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
  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 (file)

    File to remove star from.

  • :file_comment (Object)

    File comment to remove star from.

  • :channel (channel)

    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:



53
54
55
56
# File 'lib/slack/web/api/endpoints/stars.rb', line 53

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