Class: Twitch::BlockedTermsResource
- Defined in:
- lib/twitch/resources/blocked_terms.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#create(broadcaster_id:, moderator_id:, text:) ⇒ Object
Required scope: moderator:manage:blocked_terms moderator_id must match the currently authenticated user.
-
#delete(broadcaster_id:, moderator_id:, id:) ⇒ Object
Required scope: moderator:manage:blocked_terms moderator_id must match the currently authenticated user.
-
#list(broadcaster_id:, moderator_id:, **params) ⇒ Object
Required scope: moderator:read:blocked_terms moderator_id must match the currently authenticated user.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Twitch::Resource
Instance Method Details
#create(broadcaster_id:, moderator_id:, text:) ⇒ Object
Required scope: moderator:manage:blocked_terms moderator_id must match the currently authenticated user. Can be either the broadcaster ID or moderator ID
13 14 15 16 17 |
# File 'lib/twitch/resources/blocked_terms.rb', line 13 def create(broadcaster_id:, moderator_id:, text:) attrs = { broadcaster_id: broadcaster_id, moderator_id: moderator_id, text: text } response = post_request("moderation/blocked_terms", body: attrs) BannedUser.new response.body.dig("data")[0] end |
#delete(broadcaster_id:, moderator_id:, id:) ⇒ Object
Required scope: moderator:manage:blocked_terms moderator_id must match the currently authenticated user. Can be either the broadcaster ID or moderator ID
21 22 23 |
# File 'lib/twitch/resources/blocked_terms.rb', line 21 def delete(broadcaster_id:, moderator_id:, id:) delete_request("moderation/blocked_terms?broadcaster_id=#{broadcaster_id}&moderator_id=#{moderator_id}&id=#{id}") end |
#list(broadcaster_id:, moderator_id:, **params) ⇒ Object
Required scope: moderator:read:blocked_terms moderator_id must match the currently authenticated user. Can be either the broadcaster ID or moderator ID
5 6 7 8 9 |
# File 'lib/twitch/resources/blocked_terms.rb', line 5 def list(broadcaster_id:, moderator_id:, **params) attrs = { broadcaster_id: broadcaster_id, moderator_id: moderator_id } response = get_request("moderation/blocked_terms", params: attrs.merge(params)) Collection.from_response(response, type: BlockedTerm) end |