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
-
#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.
-
#stars_list(options = {}) ⇒ Object
This method lists the items starred by the authed user.
-
#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.
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.
22 23 24 25 |
# File 'lib/slack/web/api/endpoints/stars.rb', line 22 def stars_add( = {}) = .merge(channel: channels_id()['channel']['id']) if [:channel] post('stars.add', ) end |
#stars_list(options = {}) ⇒ Object
This method lists the items starred by the authed user.
36 37 38 39 40 41 42 43 44 |
# File 'lib/slack/web/api/endpoints/stars.rb', line 36 def stars_list( = {}) if block_given? Pagination::Cursor.new(self, :stars_list, ).each do |page| yield page end else post('stars.list', ) end 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.
60 61 62 63 |
# File 'lib/slack/web/api/endpoints/stars.rb', line 60 def stars_remove( = {}) = .merge(channel: channels_id()['channel']['id']) if [:channel] post('stars.remove', ) end |