twitchrb 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4921296177c80efd1a41535907c5e2e1ce41a6c6695e319f968a2d9bc5012e34
4
- data.tar.gz: 4ad72356f24394069cbf9a2845038db485d75fc9a273446665a18ad59b15274a
3
+ metadata.gz: f8ee21feb703fb97c6fe0d5a3dd7da8072f70d1a959fc84f5e502aaa2ec45d68
4
+ data.tar.gz: 75723ca8b4285ac950ebe0e722238b72c42b3be9d0e7214d57afbaf613586b3c
5
5
  SHA512:
6
- metadata.gz: b39f99a455e2d7b02d4c537b55e52576f2a5f232e488a90d3e48480621bec11ab92c9994c9119bacd402f3852654944103a7a1eb0b67e1d1d299e22471c3a9c0
7
- data.tar.gz: 2cd4c7b9c6582e9d337343b2dd81f9c8c14b81954dbe6795496115602e6cdd78e2809c8d5f0a004cdcb27602b271a96d68778a85720a31292db999c00f663839
6
+ metadata.gz: 28c24c46f1b678e8db7e56ff24a5e80f25b3c0a491a61373b57d98ccf9081ca2157adf91f8767c01aa23bcfbfd04559188ef589d5055aee38f6aef945e8ef21e
7
+ data.tar.gz: e6253a4bc7c31232fff212dbfddca8b86d2205c4be7bffc9da9beb5e233016a9c8bb97bfcd4147a6833521e09b01cfa2be3d3c661ceb4a33e886cbb48440c9d5
data/.github/FUNDING.yml CHANGED
@@ -1,4 +1,3 @@
1
1
  # These are supported funding model platforms
2
2
 
3
- github: deanpcmad
4
- custom: https://www.buymeacoffee.com/deanpcmad
3
+ ko_fi: deanpcmad
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twitchrb (1.0.0)
4
+ twitchrb (1.0.1)
5
5
  faraday (~> 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  dotenv (2.7.6)
11
- faraday (2.3.0)
12
- faraday-net_http (~> 2.0)
11
+ faraday (2.5.2)
12
+ faraday-net_http (>= 2.0, < 3.1)
13
13
  ruby2_keywords (>= 0.0.4)
14
- faraday-net_http (2.0.3)
14
+ faraday-net_http (3.0.0)
15
15
  minitest (5.15.0)
16
16
  rake (12.3.3)
17
17
  ruby2_keywords (0.0.5)
@@ -26,4 +26,4 @@ DEPENDENCIES
26
26
  twitchrb!
27
27
 
28
28
  BUNDLED WITH
29
- 2.3.5
29
+ 2.3.21
data/README.md CHANGED
@@ -363,6 +363,15 @@ messages = [{msg_id: "abc1", msg_text: "is this allowed?"}, {msg_id: "abc2", msg
363
363
  @client.blocked_terms.delete broadcaster_id: 123, moderator_id: 321, id: "abc12-12abc"
364
364
  ```
365
365
 
366
+ ## Charity Campaigns
367
+
368
+ ```ruby
369
+ # Gets information about the charity campaign that a broadcaster is running
370
+ # Required scope: channel:read:charity
371
+ # broadcaster_id must match the currently authenticated user
372
+ @client.charity_campaigns.list broadcaster_id: 123
373
+ ```
374
+
366
375
  ## Contributing
367
376
 
368
377
  Bug reports and pull requests are welcome on GitHub at https://github.com/twitchrb/twitchrb.
data/lib/twitch/client.rb CHANGED
@@ -137,6 +137,10 @@ module Twitch
137
137
  BlockedTermsResource.new(self)
138
138
  end
139
139
 
140
+ def charity_campaigns
141
+ CharityCampaignsResource.new(self)
142
+ end
143
+
140
144
  def connection
141
145
  @connection ||= Faraday.new(BASE_URL) do |conn|
142
146
  conn.request :authorization, :Bearer, access_token
@@ -0,0 +1,4 @@
1
+ module Twitch
2
+ class CharityCampaign < Object
3
+ end
4
+ end
@@ -0,0 +1,12 @@
1
+ module Twitch
2
+ class CharityCampaignsResource < Resource
3
+
4
+ # Required scope: channel:read:charity
5
+ # Broadcaster ID must match the user in the OAuth token
6
+ def list(broadcaster_id:)
7
+ response = get_request("charity/campaigns?broadcaster_id=#{broadcaster_id}")
8
+ Collection.from_response(response, type: CharityCampaign)
9
+ end
10
+
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Twitch
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/twitch.rb CHANGED
@@ -42,6 +42,7 @@ module Twitch
42
42
  autoload :WhispersResource, "twitch/resources/whispers"
43
43
  autoload :AutomodResource, "twitch/resources/automod"
44
44
  autoload :BlockedTermsResource, "twitch/resources/blocked_terms"
45
+ autoload :CharityCampaignsResource, "twitch/resources/charity_campaigns"
45
46
 
46
47
 
47
48
  autoload :User, "twitch/objects/user"
@@ -80,5 +81,6 @@ module Twitch
80
81
  autoload :AutomodStatus, "twitch/objects/automod_status"
81
82
  autoload :AutomodSetting, "twitch/objects/automod_setting"
82
83
  autoload :BlockedTerm, "twitch/objects/blocked_term"
84
+ autoload :CHarityCampaign, "twitch/objects/charity_campaign"
83
85
 
84
86
  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.0.0
4
+ version: 1.0.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: 2022-07-18 00:00:00.000000000 Z
11
+ date: 2022-08-26 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: []
@@ -56,6 +56,7 @@ files:
56
56
  - lib/twitch/objects/blocked_user.rb
57
57
  - lib/twitch/objects/channel.rb
58
58
  - lib/twitch/objects/channel_editor.rb
59
+ - lib/twitch/objects/charity_campaign.rb
59
60
  - lib/twitch/objects/clip.rb
60
61
  - lib/twitch/objects/custom_reward.rb
61
62
  - lib/twitch/objects/custom_reward_redemption.rb
@@ -90,6 +91,7 @@ files:
90
91
  - lib/twitch/resources/banned_users.rb
91
92
  - lib/twitch/resources/blocked_terms.rb
92
93
  - lib/twitch/resources/channels.rb
94
+ - lib/twitch/resources/charity_campaigns.rb
93
95
  - lib/twitch/resources/chat_messages.rb
94
96
  - lib/twitch/resources/clips.rb
95
97
  - lib/twitch/resources/custom_reward_redemptions.rb
@@ -123,7 +125,7 @@ licenses:
123
125
  metadata:
124
126
  homepage_uri: https://deanpcmad.com
125
127
  source_code_uri: https://github.com/deanpcmad/twitchrb
126
- post_install_message:
128
+ post_install_message:
127
129
  rdoc_options: []
128
130
  require_paths:
129
131
  - lib
@@ -139,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
141
  version: '0'
140
142
  requirements: []
141
143
  rubygems_version: 3.3.7
142
- signing_key:
144
+ signing_key:
143
145
  specification_version: 4
144
146
  summary: A Ruby library for interacting with the Twitch Helix API
145
147
  test_files: []