Class: WhopSDK::Resources::Reactions
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Reactions
- Defined in:
- lib/whop_sdk/resources/reactions.rb
Overview
Reactions
Instance Method Summary collapse
-
#create(resource_id:, emoji: nil, poll_option_id: nil, request_options: {}) ⇒ WhopSDK::Models::Reaction
Some parameter documentations has been truncated, see Models::ReactionCreateParams for more details.
-
#delete(id, emoji: nil, request_options: {}) ⇒ Boolean
Some parameter documentations has been truncated, see Models::ReactionDeleteParams for more details.
-
#initialize(client:) ⇒ Reactions
constructor
private
A new instance of Reactions.
-
#list(resource_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ReactionListResponse>
Returns a paginated list of emoji reactions on a specific message or forum post, sorted by most recent.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Reaction
Retrieves the details of an existing reaction.
Constructor Details
#initialize(client:) ⇒ Reactions
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Reactions.
138 139 140 |
# File 'lib/whop_sdk/resources/reactions.rb', line 138 def initialize(client:) @client = client end |
Instance Method Details
#create(resource_id:, emoji: nil, poll_option_id: nil, request_options: {}) ⇒ WhopSDK::Models::Reaction
Some parameter documentations has been truncated, see Models::ReactionCreateParams for more details.
Add an emoji reaction or poll vote to a message or forum post. In forums, the reaction is always a like.
Required permissions:
-
‘chat:read`
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/whop_sdk/resources/reactions.rb', line 30 def create(params) parsed, = WhopSDK::ReactionCreateParams.dump_request(params) @client.request( method: :post, path: "reactions", body: parsed, model: WhopSDK::Reaction, options: ) end |
#delete(id, emoji: nil, request_options: {}) ⇒ Boolean
Some parameter documentations has been truncated, see Models::ReactionDeleteParams for more details.
Remove an emoji reaction from a message or forum post. Only the reaction author or a channel admin can remove a reaction.
Required permissions:
-
‘chat:read`
123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/whop_sdk/resources/reactions.rb', line 123 def delete(id, params = {}) parsed, = WhopSDK::ReactionDeleteParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["reactions/%1$s", id], query: query, model: WhopSDK::Internal::Type::Boolean, options: ) end |
#list(resource_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::ReactionListResponse>
Returns a paginated list of emoji reactions on a specific message or forum post, sorted by most recent.
Required permissions:
-
‘chat:read`
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/whop_sdk/resources/reactions.rb', line 89 def list(params) parsed, = WhopSDK::ReactionListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "reactions", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::ReactionListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Reaction
Retrieves the details of an existing reaction.
Required permissions:
-
‘chat:read`
56 57 58 59 60 61 62 63 |
# File 'lib/whop_sdk/resources/reactions.rb', line 56 def retrieve(id, params = {}) @client.request( method: :get, path: ["reactions/%1$s", id], model: WhopSDK::Reaction, options: params[:request_options] ) end |