Module: Slack::Web::Api::Endpoints::Reactions
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/reactions.rb
Instance Method Summary collapse
-
#reactions_add(options = {}) ⇒ Object
Adds a reaction to an item.
-
#reactions_get(options = {}) ⇒ Object
Gets reactions for an item.
-
#reactions_list(options = {}) ⇒ Object
Lists reactions made by a user.
-
#reactions_remove(options = {}) ⇒ Object
Removes a reaction from an item.
Instance Method Details
#reactions_add(options = {}) ⇒ Object
Adds a reaction to an item.
20 21 22 23 24 25 26 |
# File 'lib/slack/web/api/endpoints/reactions.rb', line 20 def reactions_add( = {}) raise ArgumentError, 'Required arguments :channel missing' if [:channel].nil? raise ArgumentError, 'Required arguments :name missing' if [:name].nil? raise ArgumentError, 'Required arguments :timestamp missing' if [:timestamp].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('reactions.add', ) end |
#reactions_get(options = {}) ⇒ Object
Gets reactions for an item.
43 44 45 46 |
# File 'lib/slack/web/api/endpoints/reactions.rb', line 43 def reactions_get( = {}) = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('reactions.get', ) end |
#reactions_list(options = {}) ⇒ Object
Lists reactions made by a user.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/slack/web/api/endpoints/reactions.rb', line 63 def reactions_list( = {}) = .merge(user: users_id()['user']['id']) if [:user] if block_given? Pagination::Cursor.new(self, :reactions_list, ).each do |page| yield page end else post('reactions.list', ) end end |
#reactions_remove(options = {}) ⇒ Object
Removes a reaction from an item.
89 90 91 92 93 |
# File 'lib/slack/web/api/endpoints/reactions.rb', line 89 def reactions_remove( = {}) raise ArgumentError, 'Required arguments :name missing' if [:name].nil? = .merge(channel: conversations_id()['channel']['id']) if [:channel] post('reactions.remove', ) end |