twitchrb 1.4.0 → 1.6.0
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 +4 -4
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/ci.yml +4 -4
- data/.rubocop.yml +3 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +64 -56
- data/README.md +216 -0
- data/lib/twitch/error_generator.rb +18 -3
- data/lib/twitch/version.rb +1 -1
- data/mise.toml +2 -0
- data/twitchrb.gemspec +2 -1
- metadata +21 -10
- data/lib/twitch/resources/event_sub_conduit.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7327c8f6f44058116d61066e6d7eee668c60850de7772b56c041d6fb03d2272
|
4
|
+
data.tar.gz: abac199ef5acc9ab8717f1438d9d883c5c24c7858194b88c2692a2ed625b61e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83fb8d523ae645817738457fd9377c56d9f6d022dec7e64df8c454177485649964715bb924b12525022a99ca9ca3552d34b5e6becfb1b1c3c0811a7818eefe0f
|
7
|
+
data.tar.gz: 82752078c2845fb4eeabbd5cff02d393ae693997d25ef454455fbe2371e5259c962b93d9779b4dddd70b3e0d4225d9a0b63a93156e75ac1dadbedb8958b78a94
|
data/.github/workflows/ci.yml
CHANGED
@@ -11,11 +11,11 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
steps:
|
13
13
|
- name: Checkout code
|
14
|
-
uses: actions/checkout@
|
14
|
+
uses: actions/checkout@v5
|
15
15
|
- name: Set up Ruby
|
16
16
|
uses: ruby/setup-ruby@v1
|
17
17
|
with:
|
18
|
-
ruby-version: '3.
|
18
|
+
ruby-version: '3.4'
|
19
19
|
bundler-cache: true
|
20
20
|
- name: Lint code for consistent style
|
21
21
|
run: bundle exec rubocop -f github
|
@@ -27,11 +27,11 @@ jobs:
|
|
27
27
|
fail-fast: false
|
28
28
|
matrix:
|
29
29
|
ruby_version:
|
30
|
-
- '3.1'
|
31
30
|
- '3.2'
|
32
31
|
- '3.3'
|
32
|
+
- '3.4'
|
33
33
|
steps:
|
34
|
-
- uses: actions/checkout@
|
34
|
+
- uses: actions/checkout@v5
|
35
35
|
- uses: ruby/setup-ruby@v1
|
36
36
|
with:
|
37
37
|
ruby-version: ${{ matrix.ruby_version }}
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,95 +1,103 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
twitchrb (1.
|
5
|
-
faraday (~> 2.
|
4
|
+
twitchrb (1.6.0)
|
5
|
+
faraday (~> 2.11)
|
6
|
+
ostruct (~> 0.6.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
|
-
activesupport (7.
|
11
|
+
activesupport (7.2.2.2)
|
11
12
|
base64
|
13
|
+
benchmark (>= 0.3)
|
12
14
|
bigdecimal
|
13
|
-
concurrent-ruby (~> 1.0, >= 1.
|
15
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
14
16
|
connection_pool (>= 2.2.5)
|
15
17
|
drb
|
16
18
|
i18n (>= 1.6, < 2)
|
19
|
+
logger (>= 1.4.2)
|
17
20
|
minitest (>= 5.1)
|
18
|
-
|
19
|
-
tzinfo (~> 2.0)
|
20
|
-
ast (2.4.
|
21
|
-
base64 (0.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
securerandom (>= 0.3)
|
22
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
23
|
+
ast (2.4.3)
|
24
|
+
base64 (0.3.0)
|
25
|
+
benchmark (0.4.1)
|
26
|
+
bigdecimal (3.2.3)
|
27
|
+
concurrent-ruby (1.3.5)
|
28
|
+
connection_pool (2.5.4)
|
29
|
+
dotenv (3.1.8)
|
30
|
+
drb (2.2.3)
|
31
|
+
faraday (2.13.4)
|
32
|
+
faraday-net_http (>= 2.0, < 3.5)
|
33
|
+
json
|
29
34
|
logger
|
30
|
-
faraday-net_http (3.
|
31
|
-
net-http
|
32
|
-
i18n (1.14.
|
35
|
+
faraday-net_http (3.4.1)
|
36
|
+
net-http (>= 0.5.0)
|
37
|
+
i18n (1.14.7)
|
33
38
|
concurrent-ruby (~> 1.0)
|
34
|
-
json (2.
|
35
|
-
language_server-protocol (3.17.0.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
net-http (0.
|
39
|
+
json (2.13.2)
|
40
|
+
language_server-protocol (3.17.0.5)
|
41
|
+
lint_roller (1.1.0)
|
42
|
+
logger (1.7.0)
|
43
|
+
minitest (5.25.5)
|
44
|
+
net-http (0.6.0)
|
40
45
|
uri
|
41
|
-
|
42
|
-
|
46
|
+
ostruct (0.6.3)
|
47
|
+
parallel (1.27.0)
|
48
|
+
parser (3.3.9.0)
|
43
49
|
ast (~> 2.4.1)
|
44
50
|
racc
|
51
|
+
prism (1.5.0)
|
45
52
|
racc (1.8.1)
|
46
|
-
rack (3.1
|
53
|
+
rack (3.2.1)
|
47
54
|
rainbow (3.1.1)
|
48
55
|
rake (12.3.3)
|
49
|
-
regexp_parser (2.
|
50
|
-
|
51
|
-
strscan
|
52
|
-
rubocop (1.65.1)
|
56
|
+
regexp_parser (2.11.2)
|
57
|
+
rubocop (1.80.2)
|
53
58
|
json (~> 2.3)
|
54
|
-
language_server-protocol (
|
59
|
+
language_server-protocol (~> 3.17.0.2)
|
60
|
+
lint_roller (~> 1.1.0)
|
55
61
|
parallel (~> 1.10)
|
56
62
|
parser (>= 3.3.0.2)
|
57
63
|
rainbow (>= 2.2.2, < 4.0)
|
58
|
-
regexp_parser (>= 2.
|
59
|
-
|
60
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
64
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
65
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
61
66
|
ruby-progressbar (~> 1.7)
|
62
|
-
unicode-display_width (>= 2.4.0, <
|
63
|
-
rubocop-ast (1.
|
64
|
-
parser (>= 3.3.
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
rubocop (>= 1.
|
70
|
-
|
71
|
-
rubocop-rails (2.25.1)
|
67
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
68
|
+
rubocop-ast (1.46.0)
|
69
|
+
parser (>= 3.3.7.2)
|
70
|
+
prism (~> 1.4)
|
71
|
+
rubocop-performance (1.26.0)
|
72
|
+
lint_roller (~> 1.1)
|
73
|
+
rubocop (>= 1.75.0, < 2.0)
|
74
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
75
|
+
rubocop-rails (2.33.3)
|
72
76
|
activesupport (>= 4.2.0)
|
77
|
+
lint_roller (~> 1.1)
|
73
78
|
rack (>= 1.1)
|
74
|
-
rubocop (>= 1.
|
75
|
-
rubocop-ast (>= 1.
|
76
|
-
rubocop-rails-omakase (1.
|
77
|
-
rubocop
|
78
|
-
rubocop-
|
79
|
-
rubocop-
|
80
|
-
rubocop-rails
|
79
|
+
rubocop (>= 1.75.0, < 2.0)
|
80
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
81
|
+
rubocop-rails-omakase (1.1.0)
|
82
|
+
rubocop (>= 1.72)
|
83
|
+
rubocop-performance (>= 1.24)
|
84
|
+
rubocop-rails (>= 2.30)
|
81
85
|
ruby-progressbar (1.13.0)
|
82
|
-
|
86
|
+
securerandom (0.4.1)
|
83
87
|
tzinfo (2.0.6)
|
84
88
|
concurrent-ruby (~> 1.0)
|
85
|
-
unicode-display_width (2.
|
86
|
-
|
87
|
-
|
89
|
+
unicode-display_width (3.2.0)
|
90
|
+
unicode-emoji (~> 4.1)
|
91
|
+
unicode-emoji (4.1.0)
|
92
|
+
uri (1.0.3)
|
93
|
+
vcr (6.3.1)
|
94
|
+
base64
|
88
95
|
|
89
96
|
PLATFORMS
|
90
97
|
ruby
|
91
98
|
|
92
99
|
DEPENDENCIES
|
100
|
+
activesupport (>= 4.2.0, < 8.0)
|
93
101
|
dotenv
|
94
102
|
minitest (~> 5.0)
|
95
103
|
rake (~> 12.0)
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# TwitchRB
|
2
2
|
|
3
|
+
[](https://github.com/deanpcmad/twitchrb/actions/workflows/ci.yml)
|
4
|
+
[](https://badge.fury.io/rb/twitchrb)
|
5
|
+
[](https://rubygems.org/gems/twitchrb)
|
6
|
+
|
3
7
|
TwitchRB is the easiest and most complete Ruby library for the [Twitch Helix API](https://dev.twitch.tv/docs/api).
|
4
8
|
|
5
9
|
## Installation
|
@@ -275,6 +279,44 @@ These require an application OAuth access token.
|
|
275
279
|
@client.eventsub_subscriptions.delete(id: "abc12-abc12-abc12")
|
276
280
|
```
|
277
281
|
|
282
|
+
### EventSub Conduits
|
283
|
+
|
284
|
+
Conduits provide a way to receive events over multiple transports. These require an application OAuth access token.
|
285
|
+
|
286
|
+
```ruby
|
287
|
+
# List all conduits for your application
|
288
|
+
@client.eventsub_conduits.list
|
289
|
+
|
290
|
+
# Create a conduit with a specified number of shards
|
291
|
+
# shard_count must be between 1 and 100
|
292
|
+
@client.eventsub_conduits.create(shard_count: 10)
|
293
|
+
|
294
|
+
# Update a conduit's shard count
|
295
|
+
@client.eventsub_conduits.update(id: "abc123-def456", shard_count: 20)
|
296
|
+
|
297
|
+
# Delete a conduit
|
298
|
+
@client.eventsub_conduits.delete(id: "abc123-def456")
|
299
|
+
|
300
|
+
# List shards for a conduit
|
301
|
+
# Optional parameters: status, after
|
302
|
+
@client.eventsub_conduits.shards(id: "abc123-def456")
|
303
|
+
@client.eventsub_conduits.shards(id: "abc123-def456", status: "enabled")
|
304
|
+
|
305
|
+
# Update shards for a conduit
|
306
|
+
# shards is an array of shard objects with id and transport properties
|
307
|
+
shards = [
|
308
|
+
{
|
309
|
+
id: "0",
|
310
|
+
transport: {
|
311
|
+
method: "webhook",
|
312
|
+
callback: "https://example.com/webhooks/callback",
|
313
|
+
secret: "your-secret"
|
314
|
+
}
|
315
|
+
}
|
316
|
+
]
|
317
|
+
@client.eventsub_conduits.update_shards(id: "abc123-def456", shards: shards)
|
318
|
+
```
|
319
|
+
|
278
320
|
### Banned Events
|
279
321
|
|
280
322
|
```ruby
|
@@ -564,6 +606,180 @@ messages = [{msg_id: "abc1", msg_text: "is this allowed?"}, {msg_id: "abc2", msg
|
|
564
606
|
@client.warnings.create broadcaster_id: 123, moderator_id: 123, user_id: 321, reason: "dont do that"
|
565
607
|
```
|
566
608
|
|
609
|
+
### Streams
|
610
|
+
|
611
|
+
```ruby
|
612
|
+
# List live streams
|
613
|
+
# Available parameters: user_id, user_login, game_id, type, language, first, before, after
|
614
|
+
@client.streams.list
|
615
|
+
@client.streams.list(game_id: "509658")
|
616
|
+
@client.streams.list(user_login: "twitchdev")
|
617
|
+
|
618
|
+
# Get followed streams for a user
|
619
|
+
# Required scope: user:read:follows
|
620
|
+
# user_id must match the currently authenticated user
|
621
|
+
@client.streams.followed(user_id: 123)
|
622
|
+
```
|
623
|
+
|
624
|
+
### Polls
|
625
|
+
|
626
|
+
```ruby
|
627
|
+
# List polls for a broadcaster
|
628
|
+
# broadcaster_id must match the currently authenticated user
|
629
|
+
@client.polls.list(broadcaster_id: 123)
|
630
|
+
|
631
|
+
# Create a poll
|
632
|
+
# broadcaster_id must match the currently authenticated user
|
633
|
+
# duration is in seconds (15-1800)
|
634
|
+
choices = [
|
635
|
+
{ title: "Choice 1" },
|
636
|
+
{ title: "Choice 2" }
|
637
|
+
]
|
638
|
+
@client.polls.create(broadcaster_id: 123, title: "What should I play?", choices: choices, duration: 300)
|
639
|
+
|
640
|
+
# End a poll
|
641
|
+
# broadcaster_id must match the currently authenticated user
|
642
|
+
# status can be "TERMINATED" or "ARCHIVED"
|
643
|
+
@client.polls.end(broadcaster_id: 123, id: "poll-id", status: "terminated")
|
644
|
+
```
|
645
|
+
|
646
|
+
### Predictions
|
647
|
+
|
648
|
+
```ruby
|
649
|
+
# List predictions for a broadcaster
|
650
|
+
# broadcaster_id must match the currently authenticated user
|
651
|
+
@client.predictions.list(broadcaster_id: 123)
|
652
|
+
|
653
|
+
# Create a prediction
|
654
|
+
# broadcaster_id must match the currently authenticated user
|
655
|
+
# duration is in seconds (30-1800)
|
656
|
+
outcomes = [
|
657
|
+
{ title: "Outcome 1" },
|
658
|
+
{ title: "Outcome 2" }
|
659
|
+
]
|
660
|
+
@client.predictions.create(broadcaster_id: 123, title: "Will I win?", outcomes: outcomes, duration: 600)
|
661
|
+
|
662
|
+
# End a prediction
|
663
|
+
# broadcaster_id must match the currently authenticated user
|
664
|
+
# status can be "RESOLVED", "CANCELED", or "LOCKED"
|
665
|
+
# winning_outcome_id is required when status is "RESOLVED"
|
666
|
+
@client.predictions.end(broadcaster_id: 123, id: "prediction-id", status: "resolved", winning_outcome_id: "outcome-id")
|
667
|
+
```
|
668
|
+
|
669
|
+
### Subscriptions
|
670
|
+
|
671
|
+
```ruby
|
672
|
+
# Get all subscriptions for a broadcaster
|
673
|
+
# Required scope: channel:read:subscriptions
|
674
|
+
# broadcaster_id must match the currently authenticated user
|
675
|
+
@client.subscriptions.list(broadcaster_id: 123)
|
676
|
+
|
677
|
+
# Check if a user is subscribed to a broadcaster
|
678
|
+
# Required scope: user:read:subscriptions
|
679
|
+
# user_id must match the currently authenticated user
|
680
|
+
@client.subscriptions.is_subscribed(broadcaster_id: 123, user_id: 456)
|
681
|
+
|
682
|
+
# Get subscription counts and points for a broadcaster
|
683
|
+
# Required scope: channel:read:subscriptions
|
684
|
+
# broadcaster_id must match the currently authenticated user
|
685
|
+
@client.subscriptions.counts(broadcaster_id: 123)
|
686
|
+
```
|
687
|
+
|
688
|
+
### Search
|
689
|
+
|
690
|
+
```ruby
|
691
|
+
# Search for categories/games
|
692
|
+
@client.search.categories(query: "Just Chatting")
|
693
|
+
|
694
|
+
# Search for channels
|
695
|
+
@client.search.channels(query: "twitchdev")
|
696
|
+
```
|
697
|
+
|
698
|
+
### Stream Schedule
|
699
|
+
|
700
|
+
```ruby
|
701
|
+
# Get stream schedule for a broadcaster
|
702
|
+
# broadcaster_id must match the currently authenticated user
|
703
|
+
@client.stream_schedule.list(broadcaster_id: 123)
|
704
|
+
|
705
|
+
# Get iCalendar format of stream schedule
|
706
|
+
# broadcaster_id must match the currently authenticated user
|
707
|
+
@client.stream_schedule.icalendar(broadcaster_id: 123)
|
708
|
+
|
709
|
+
# Update stream schedule settings
|
710
|
+
# broadcaster_id must match the currently authenticated user
|
711
|
+
@client.stream_schedule.update(broadcaster_id: 123, is_vacation_enabled: true)
|
712
|
+
|
713
|
+
# Create a schedule segment
|
714
|
+
# broadcaster_id must match the currently authenticated user
|
715
|
+
@client.stream_schedule.create_segment(
|
716
|
+
broadcaster_id: 123,
|
717
|
+
start_time: "2023-08-01T16:00:00Z",
|
718
|
+
timezone: "America/New_York",
|
719
|
+
duration: "240",
|
720
|
+
is_recurring: false,
|
721
|
+
category_id: "509658",
|
722
|
+
title: "Special Stream"
|
723
|
+
)
|
724
|
+
|
725
|
+
# Update a schedule segment
|
726
|
+
# broadcaster_id must match the currently authenticated user
|
727
|
+
@client.stream_schedule.update_segment(broadcaster_id: 123, id: "segment-id", title: "Updated Title")
|
728
|
+
|
729
|
+
# Delete a schedule segment
|
730
|
+
# broadcaster_id must match the currently authenticated user
|
731
|
+
@client.stream_schedule.delete_segment(broadcaster_id: 123, id: "segment-id")
|
732
|
+
```
|
733
|
+
|
734
|
+
### Stream Markers
|
735
|
+
|
736
|
+
```ruby
|
737
|
+
# Create a stream marker
|
738
|
+
# Required scope: channel:manage:broadcast
|
739
|
+
# user_id must match the currently authenticated user
|
740
|
+
@client.stream_markers.create(user_id: 123, description: "Important moment")
|
741
|
+
|
742
|
+
# Get stream markers for a user or video
|
743
|
+
# Required scope: user:read:broadcast
|
744
|
+
# user_id must match the currently authenticated user
|
745
|
+
@client.stream_markers.list(user_id: 123)
|
746
|
+
@client.stream_markers.list(video_id: "video-id")
|
747
|
+
```
|
748
|
+
|
749
|
+
### Tags
|
750
|
+
|
751
|
+
```ruby
|
752
|
+
# Get all stream tags
|
753
|
+
@client.tags.list
|
754
|
+
|
755
|
+
# Get stream tags for a specific broadcaster
|
756
|
+
@client.tags.stream(broadcaster_id: 123)
|
757
|
+
|
758
|
+
# Replace stream tags for a broadcaster
|
759
|
+
# Required scope: channel:manage:broadcast
|
760
|
+
# broadcaster_id must match the currently authenticated user
|
761
|
+
tag_ids = ["tag-id-1", "tag-id-2"]
|
762
|
+
@client.tags.replace(broadcaster_id: 123, tag_ids: tag_ids)
|
763
|
+
```
|
764
|
+
|
765
|
+
### Hype Train Events
|
766
|
+
|
767
|
+
```ruby
|
768
|
+
# Get hype train events for a broadcaster
|
769
|
+
# Required scope: channel:read:hype_train
|
770
|
+
# broadcaster_id must match the currently authenticated user
|
771
|
+
@client.hype_train_events.list(broadcaster_id: 123)
|
772
|
+
```
|
773
|
+
|
774
|
+
### Moderator Events
|
775
|
+
|
776
|
+
```ruby
|
777
|
+
# Get moderator events for a broadcaster
|
778
|
+
# Required scope: moderation:read
|
779
|
+
# broadcaster_id must match the currently authenticated user
|
780
|
+
@client.moderator_events.list(broadcaster_id: 123)
|
781
|
+
```
|
782
|
+
|
567
783
|
|
568
784
|
## Contributing
|
569
785
|
|
@@ -14,12 +14,27 @@ module Twitch
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def set_twitch_error_values
|
17
|
-
|
18
|
-
@
|
17
|
+
parsed_body = parse_response_body
|
18
|
+
@twitch_error_code = parsed_body.dig("error")
|
19
|
+
@twitch_error_message = parsed_body.dig("message")
|
20
|
+
end
|
21
|
+
|
22
|
+
def parse_response_body
|
23
|
+
case @response_body
|
24
|
+
when Hash
|
25
|
+
@response_body
|
26
|
+
when String
|
27
|
+
JSON.parse(@response_body)
|
28
|
+
else
|
29
|
+
{}
|
30
|
+
end
|
31
|
+
rescue JSON::ParserError
|
32
|
+
{}
|
19
33
|
end
|
20
34
|
|
21
35
|
def error_message
|
22
|
-
|
36
|
+
parsed_body = parse_response_body
|
37
|
+
@twitch_error_message || parsed_body.dig("error")
|
23
38
|
rescue NoMethodError
|
24
39
|
"An unknown error occurred."
|
25
40
|
end
|
data/lib/twitch/version.rb
CHANGED
data/mise.toml
ADDED
data/twitchrb.gemspec
CHANGED
@@ -24,5 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = [ "lib" ]
|
26
26
|
|
27
|
-
spec.add_dependency "faraday", "~> 2.
|
27
|
+
spec.add_dependency "faraday", "~> 2.11"
|
28
|
+
spec.add_dependency "ostruct", "~> 0.6.0"
|
28
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitchrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Perry
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: faraday
|
@@ -16,15 +15,28 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
18
|
+
version: '2.11'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
27
|
-
|
25
|
+
version: '2.11'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: ostruct
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.6.0
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.6.0
|
28
40
|
email:
|
29
41
|
- dean@deanpcmad.com
|
30
42
|
executables: []
|
@@ -33,6 +45,7 @@ extra_rdoc_files: []
|
|
33
45
|
files:
|
34
46
|
- ".env.example"
|
35
47
|
- ".github/FUNDING.yml"
|
48
|
+
- ".github/dependabot.yml"
|
36
49
|
- ".github/workflows/ci.yml"
|
37
50
|
- ".gitignore"
|
38
51
|
- ".rubocop.yml"
|
@@ -107,7 +120,6 @@ files:
|
|
107
120
|
- lib/twitch/resources/custom_reward_redemptions.rb
|
108
121
|
- lib/twitch/resources/custom_rewards.rb
|
109
122
|
- lib/twitch/resources/emotes.rb
|
110
|
-
- lib/twitch/resources/event_sub_conduit.rb
|
111
123
|
- lib/twitch/resources/eventsub_conduits.rb
|
112
124
|
- lib/twitch/resources/eventsub_subscriptions.rb
|
113
125
|
- lib/twitch/resources/games.rb
|
@@ -133,6 +145,7 @@ files:
|
|
133
145
|
- lib/twitch/resources/whispers.rb
|
134
146
|
- lib/twitch/version.rb
|
135
147
|
- lib/twitchrb.rb
|
148
|
+
- mise.toml
|
136
149
|
- twitchrb.gemspec
|
137
150
|
homepage: https://deanpcmad.com
|
138
151
|
licenses:
|
@@ -140,7 +153,6 @@ licenses:
|
|
140
153
|
metadata:
|
141
154
|
homepage_uri: https://deanpcmad.com
|
142
155
|
source_code_uri: https://github.com/deanpcmad/twitchrb
|
143
|
-
post_install_message:
|
144
156
|
rdoc_options: []
|
145
157
|
require_paths:
|
146
158
|
- lib
|
@@ -155,8 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
167
|
- !ruby/object:Gem::Version
|
156
168
|
version: '0'
|
157
169
|
requirements: []
|
158
|
-
rubygems_version: 3.
|
159
|
-
signing_key:
|
170
|
+
rubygems_version: 3.6.7
|
160
171
|
specification_version: 4
|
161
172
|
summary: A Ruby library for interacting with the Twitch Helix API
|
162
173
|
test_files: []
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Twitch
|
2
|
-
class EventSubSubscriptionsResource < Resource
|
3
|
-
def list(**params)
|
4
|
-
response = get_request("eventsub/subscriptions", params: params)
|
5
|
-
Collection.from_response(response, type: EventSubSubscription)
|
6
|
-
end
|
7
|
-
|
8
|
-
def create(type:, version:, condition:, transport:, **params)
|
9
|
-
attributes = { type: type, version: version, condition: condition, transport: transport }.merge(params)
|
10
|
-
response = post_request("eventsub/subscriptions", body: attributes)
|
11
|
-
|
12
|
-
EventSubSubscription.new(response.body.dig("data")[0]) if response.success?
|
13
|
-
end
|
14
|
-
|
15
|
-
def delete(id:)
|
16
|
-
delete_request("eventsub/subscriptions", params: { id: id })
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|