twitchrb 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62be7346346cf921307a581b64b68bd364342b81a93e334b4fbf1ffd8198b6c2
4
- data.tar.gz: 6d4a106e899173699181fd01e0be36d2461287b6c8520d83293421a2e6a5704c
3
+ metadata.gz: 15c7d6175a906c3469b5d3ac691f66ef8f86d0682959a648b69cb0d35f39523f
4
+ data.tar.gz: 8a505c88b94833d36805006b7a8ab1e6cb54e76ecb05cb99ffb81cca5c7bd491
5
5
  SHA512:
6
- metadata.gz: aa82df2fb8d72bfd37b36abfaa51c01bc0159ff764fa2f2f7da927b04166bb4d3b5fbe1023cd3d8a0a36689d39707743d9b2c1fcffe1615de2606a739cf4685b
7
- data.tar.gz: 18faf9bc25f3d9d98910434835d73c02e5f0acd3a942639ee72ae0759b07c0b8f2035d56b11486c27b50e2fbb16292ad8d99002f3a1236160ef950a4829422ef
6
+ metadata.gz: 197a13bac91e7f1ff361bf021cff8f2c15a7d9b6f1812a393908fffd9cf0df34cf71863521c8ca85253dfeeab4ac9c81388ced713a047babfcc449fc1d906672
7
+ data.tar.gz: 992d0eb6c70cde046b94b42d2c969c3530ebbc9dfc3b14cf288b0d804280fc4af03347361fc311889aa268049bdf1e7fdec2c8121f924492850dd6eb365a994d
data/.github/FUNDING.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  # These are supported funding model platforms
2
2
 
3
+ github: deanpcmad
3
4
  ko_fi: deanpcmad
@@ -7,10 +7,10 @@ jobs:
7
7
  fail-fast: false
8
8
  matrix:
9
9
  ruby_version:
10
- - 2.7
11
- - 3.0
12
- - 3.1
13
- - 3.2
10
+ - '3.0'
11
+ - '3.1'
12
+ - '3.2'
13
+ - '3.3'
14
14
  steps:
15
15
  - uses: actions/checkout@v3
16
16
  - uses: ruby/setup-ruby@v1
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twitchrb (1.2.0)
4
+ twitchrb (1.2.1)
5
5
  faraday (~> 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- base64 (0.1.1)
10
+ base64 (0.2.0)
11
11
  dotenv (2.7.6)
12
- faraday (2.7.11)
12
+ faraday (2.8.1)
13
13
  base64
14
14
  faraday-net_http (>= 2.0, < 3.1)
15
15
  ruby2_keywords (>= 0.0.4)
data/README.md CHANGED
@@ -174,7 +174,7 @@ attributes = {title: "My new title"}
174
174
  @client.games.retrieve(names: ["Battlefield 4", "Battlefield 2042"])
175
175
  ```
176
176
 
177
- ## EventSub Subscriptions
177
+ ### EventSub Subscriptions
178
178
 
179
179
  These require an application OAuth access token.
180
180
 
@@ -198,7 +198,7 @@ These require an application OAuth access token.
198
198
  @client.eventsub_subscriptions.delete(id: "abc12-abc12-abc12")
199
199
  ```
200
200
 
201
- ## Banned Events
201
+ ### Banned Events
202
202
 
203
203
  ```ruby
204
204
  # Retrieves all ban and un-ban events for a channel
@@ -206,7 +206,7 @@ These require an application OAuth access token.
206
206
  @client.banned_events.list(broadcaster_id: 123)
207
207
  ```
208
208
 
209
- ## Banned Users
209
+ ### Banned Users
210
210
 
211
211
  ```ruby
212
212
  # Retrieves all banned and timed-out users for a channel
@@ -228,7 +228,7 @@ These require an application OAuth access token.
228
228
  @client.banned_users.delete broadcaster_id: 123, moderator_id: 321, user_id: 112233
229
229
  ```
230
230
 
231
- ## Send Chat Announcement
231
+ ### Send Chat Announcement
232
232
 
233
233
  ```ruby
234
234
  # Sends an announcement to the broadcaster's chat room
@@ -238,7 +238,7 @@ These require an application OAuth access token.
238
238
  @client.announcements.create broadcaster_id: 123, moderator_id: 123, message: "test message", color: "purple"
239
239
  ```
240
240
 
241
- ## Create a Shoutout
241
+ ### Create a Shoutout
242
242
 
243
243
  ```ruby
244
244
  # Creates a Shoutout for a broadcaster
@@ -249,7 +249,7 @@ These require an application OAuth access token.
249
249
  @client.shoutouts.create from: 123, to: 321, moderator_id: 123
250
250
  ```
251
251
 
252
- ## Moderators
252
+ ### Moderators
253
253
 
254
254
  ```ruby
255
255
  # List all moderators for a broadcaster
@@ -272,7 +272,7 @@ These require an application OAuth access token.
272
272
  @client.moderators.delete broadcaster_id: 123, user_id: 321
273
273
  ```
274
274
 
275
- ## VIPs
275
+ ### VIPs
276
276
 
277
277
  ```ruby
278
278
  # List all VIPs for a broadcaster
@@ -295,7 +295,7 @@ These require an application OAuth access token.
295
295
  @client.vips.delete broadcaster_id: 123, user_id: 321
296
296
  ```
297
297
 
298
- ## Raids
298
+ ### Raids
299
299
 
300
300
  ```ruby
301
301
  # Starts a raid
@@ -317,7 +317,7 @@ These require an application OAuth access token.
317
317
  @client.chat_messages.delete broadcaster_id: 123, moderator_id: 123, message_id: "abc123-abc123"
318
318
  ```
319
319
 
320
- ## Whispers
320
+ ### Whispers
321
321
 
322
322
  ```ruby
323
323
  # Send a Whisper
@@ -326,7 +326,7 @@ These require an application OAuth access token.
326
326
  @client.whispers.create from_user_id: 123, to_user_id: 321, message: "this is a test"
327
327
  ```
328
328
 
329
- ## AutoMod
329
+ ### AutoMod
330
330
 
331
331
  ```ruby
332
332
  # Check if a message meets the channel's AutoMod requirements
@@ -360,7 +360,7 @@ messages = [{msg_id: "abc1", msg_text: "is this allowed?"}, {msg_id: "abc2", msg
360
360
  @client.automod.update_settings broadcaster_id: 123, moderator_id: 321, swearing: 1
361
361
  ```
362
362
 
363
- ## Creator Goals
363
+ ### Creator Goals
364
364
 
365
365
  ```ruby
366
366
  # List all active creator goals
@@ -369,7 +369,7 @@ messages = [{msg_id: "abc1", msg_text: "is this allowed?"}, {msg_id: "abc2", msg
369
369
  @client.goals.list broadcaster_id: 123
370
370
  ```
371
371
 
372
- ## Blocked Terms
372
+ ### Blocked Terms
373
373
 
374
374
  ```ruby
375
375
  # List all blocked terms
@@ -392,7 +392,7 @@ messages = [{msg_id: "abc1", msg_text: "is this allowed?"}, {msg_id: "abc2", msg
392
392
  @client.blocked_terms.delete broadcaster_id: 123, moderator_id: 321, id: "abc12-12abc"
393
393
  ```
394
394
 
395
- ## Charity Campaigns
395
+ ### Charity Campaigns
396
396
 
397
397
  ```ruby
398
398
  # Gets information about the charity campaign that a broadcaster is running
@@ -401,7 +401,7 @@ messages = [{msg_id: "abc1", msg_text: "is this allowed?"}, {msg_id: "abc2", msg
401
401
  @client.charity_campaigns.list broadcaster_id: 123
402
402
  ```
403
403
 
404
- ## Chatters
404
+ ### Chatters
405
405
 
406
406
  ```ruby
407
407
  # Gets the list of users that are connected to the specified broadcaster’s chat session
@@ -410,9 +410,49 @@ messages = [{msg_id: "abc1", msg_text: "is this allowed?"}, {msg_id: "abc2", msg
410
410
  @client.chatters.list broadcaster_id: 123, moderator_id: 123
411
411
  ```
412
412
 
413
+ ### Channel Points Custom Rewards
414
+
415
+ ```ruby
416
+ # Gets a list of custom rewards for a specific channel
417
+ # Required scope: channel:read:redemptions
418
+ # broadcaster_id must match the currently authenticated user
419
+ @client.custom_rewards.list broadcaster_id: 123
420
+
421
+ # Create a custom reward
422
+ # Required scope: channel:manage:redemptions
423
+ # broadcaster_id must match the currently authenticated user
424
+ @client.custom_rewards.create broadcaster_id: 123, title: "New Reward", cost: 1000
425
+
426
+ # Update a custom reward
427
+ # Required scope: channel:manage:redemptions
428
+ # broadcaster_id must match the currently authenticated user
429
+ @client.custom_rewards.update broadcaster_id: 123, reward_id: 321, title: "Updated Reward"
430
+
431
+ # Delete a custom reward
432
+ # Required scope: channel:manage:redemptions
433
+ # broadcaster_id must match the currently authenticated user
434
+ @client.custom_rewards.delete broadcaster_id: 123, reward_id: 321
435
+ ```
436
+
437
+ ### Channel Points Custom Reward Redemptions
438
+
439
+ ```ruby
440
+ # Gets a list of custom reward redemptions for a specific channel
441
+ # Required scope: channel:read:redemptions
442
+ # broadcaster_id must match the currently authenticated user
443
+ @client.custom_reward_redemptions.list broadcaster_id: 123, reward_id: 321, status: "UNFULFILLED"
444
+
445
+ # Update a custom reward redemption status
446
+ # Required scope: channel:manage:redemptions
447
+ # broadcaster_id must match the currently authenticated user
448
+ # Status can be FULFILLED or CANCELED
449
+ @client.custom_reward_redemptions.update broadcaster_id: 123, reward_id: 321, redemption_id: 123, status: "FULFILLED"
450
+ ```
451
+
452
+
413
453
  ## Contributing
414
454
 
415
- Bug reports and pull requests are welcome on GitHub at https://github.com/twitchrb/twitchrb.
455
+ Bug reports and pull requests are welcome on GitHub at https://github.com/deanpcmad/twitchrb.
416
456
 
417
457
  ## License
418
458
 
@@ -1,6 +1,6 @@
1
1
  module Twitch
2
2
  class CustomRewardRedemptionsResource < Resource
3
-
3
+
4
4
  # Required scope: channel:read:redemptions
5
5
  # Broadcaster ID must match the user in the OAuth token
6
6
  def list(broadcaster_id:, reward_id:, status:, **params)
@@ -9,14 +9,15 @@ module Twitch
9
9
  Collection.from_response(response, type: CustomRewardRedemption)
10
10
  end
11
11
 
12
- # Currently disabled as getting this error and can't work out why
13
- # Twitch::Error (Error 400: Your request was malformed. 'The parameter "id" was malformed: the value must be greater than or equal to 1')
14
- # def update(broadcaster_id:, reward_id:, redemption_id:, status:)
15
- # attributes = {broadcaster_id: broadcaster_id, reward_id: reward_id, id: redemption_id, status: status.upcase}
16
- # response = patch_request("channel_points/custom_rewards/redemptions", body: attributes)
12
+ # Required scope: channel:manage:redemptions
13
+ # Broadcaster ID must match the user in the OAuth token
14
+ def update(broadcaster_id:, reward_id:, redemption_id:, status:)
15
+ attributes = {status: status.upcase}
16
+ url = "channel_points/custom_rewards/redemptions?broadcaster_id=#{broadcaster_id}&reward_id=#{reward_id}&id=#{redemption_id}&status=#{status.upcase}"
17
+ response = patch_request(url, body: attributes)
17
18
 
18
- # CustomRewardRedemption.new(response.body.dig("data")[0]) if response.success?
19
- # end
19
+ CustomRewardRedemption.new(response.body.dig("data")[0]) if response.success?
20
+ end
20
21
 
21
22
  end
22
23
  end
@@ -1,3 +1,3 @@
1
1
  module Twitch
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitchrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-29 00:00:00.000000000 Z
11
+ date: 2024-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
- description:
27
+ description:
28
28
  email:
29
29
  - dean@deanpcmad.com
30
30
  executables: []
@@ -128,7 +128,7 @@ licenses:
128
128
  metadata:
129
129
  homepage_uri: https://deanpcmad.com
130
130
  source_code_uri: https://github.com/deanpcmad/twitchrb
131
- post_install_message:
131
+ post_install_message:
132
132
  rdoc_options: []
133
133
  require_paths:
134
134
  - lib
@@ -143,8 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.4.10
147
- signing_key:
146
+ rubygems_version: 3.4.22
147
+ signing_key:
148
148
  specification_version: 4
149
149
  summary: A Ruby library for interacting with the Twitch Helix API
150
150
  test_files: []