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
This method adds a reaction (emoji) to a message.
-
#reactions_get(options = {}) ⇒ Object
This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message).
-
#reactions_list(options = {}) ⇒ Object
This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user.
-
#reactions_remove(options = {}) ⇒ Object
This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message).
Instance Method Details
#reactions_add(options = {}) ⇒ Object
This method adds a reaction (emoji) to a message. Now that file threads work the way you’d expect, the file and file_comment arguments are deprecated. Specify channel and timestamp instead.
24 25 26 27 28 |
# File 'lib/slack/web/api/endpoints/reactions.rb', line 24 def reactions_add( = {}) throw ArgumentError.new('Required arguments :name missing') if [:name].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('reactions.add', ) end |
#reactions_get(options = {}) ⇒ Object
This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message).
45 46 47 48 |
# File 'lib/slack/web/api/endpoints/reactions.rb', line 45 def reactions_get( = {}) = .merge(channel: channels_id()['channel']['id']) if [:channel] post('reactions.get', ) end |
#reactions_list(options = {}) ⇒ Object
This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to 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
This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message). One of file, file_comment, or the combination of channel and timestamp must be specified.
90 91 92 93 94 |
# File 'lib/slack/web/api/endpoints/reactions.rb', line 90 def reactions_remove( = {}) throw ArgumentError.new('Required arguments :name missing') if [:name].nil? = .merge(channel: channels_id()['channel']['id']) if [:channel] post('reactions.remove', ) end |