twitchrb 1.0.2 → 1.0.3

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: 28141d97db1c65bc42dda669d521812ebb2e1d7fd427831fa1d8a9b6eadde7cc
4
- data.tar.gz: a9057eef186fb46f1f9d7910c724f6408b0044259171c021609d421887777d18
3
+ metadata.gz: 60c3e4872fe539340033a16467e0091ff8d0dbc4bef5f0e9f3aa71f524883b80
4
+ data.tar.gz: 76df58744f36bea5b0e8884958bbd05ff91cfce41a072b3c46c9df26aec2a0ab
5
5
  SHA512:
6
- metadata.gz: 9574825b2d2ea5e91230c2580fbd4bdc08c18b5bd7d5de1a19957f6ac199618b9cfc78ed8232cae390f03ede8249b2a06784afecb60d62cef0e335830ea9f2f7
7
- data.tar.gz: 6d877434646d740a291153a554f5af69450e9e84f042b277c65d5a5f0617caa459160ed859d4fb2ca18abd275911f8d2656b9f2b95a66b1712890f46e4d87bad
6
+ metadata.gz: 530d727b629c4c1a3c52f7839e27a69466d5af0653370b371ab33f03175665a8c8851b1058c87264011e1700dd6e7fd36eb9337b207714d332785f6c9e2d0285
7
+ data.tar.gz: 25a314a0961681b53d2fc94a2aff462bfcca32d7d2807aad3a034289ea65f3289c8dafccb2ccd9928380e9daa98ec648669b5ee1a0451c867b019102ba3d5e78
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twitchrb (1.0.2)
4
+ twitchrb (1.0.3)
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.5.2)
11
+ faraday (2.7.4)
12
12
  faraday-net_http (>= 2.0, < 3.1)
13
13
  ruby2_keywords (>= 0.0.4)
14
- faraday-net_http (3.0.0)
14
+ faraday-net_http (3.0.2)
15
15
  minitest (5.15.0)
16
16
  rake (12.3.3)
17
17
  ruby2_keywords (0.0.5)
data/README.md CHANGED
@@ -220,6 +220,17 @@ These require an application OAuth access token.
220
220
  @client.announcements.create broadcaster_id: 123, moderator_id: 123, message: "test message", color: "purple"
221
221
  ```
222
222
 
223
+ ## Create a Shoutout
224
+
225
+ ```ruby
226
+ # Creates a Shoutout for a broadcaster
227
+ # Requires moderator:manage:shoutouts
228
+ # From: the ID of the Broadcaster creating the Shoutout
229
+ # To: the ID of the Broadcaster the Shoutout will be for
230
+ # moderator_id can be either the currently authenticated moderator or the broadcaster
231
+ @client.shoutouts.create from: 123, to: 321, moderator_id: 123
232
+ ```
233
+
223
234
  ## Moderators
224
235
 
225
236
  ```ruby
data/lib/twitch/client.rb CHANGED
@@ -145,6 +145,10 @@ module Twitch
145
145
  ChattersResource.new(self)
146
146
  end
147
147
 
148
+ def shoutouts
149
+ ShoutoutsResource.new(self)
150
+ end
151
+
148
152
  def connection
149
153
  @connection ||= Faraday.new(BASE_URL) do |conn|
150
154
  conn.request :authorization, :Bearer, access_token
@@ -2,6 +2,7 @@ module Twitch
2
2
  class AnnouncementsResource < Resource
3
3
 
4
4
  # Moderator ID must match the user in the OAuth token
5
+ # Required scope: moderator:manage:announcements
5
6
  def create(broadcaster_id:, moderator_id:, message:, color: nil)
6
7
  attrs = {message: message, color: color}
7
8
 
@@ -0,0 +1,13 @@
1
+ module Twitch
2
+ class ShoutoutsResource < Resource
3
+
4
+ # Moderator ID must match the user in the OAuth token
5
+ # From: the ID of the Broadcaster creating the Shoutout
6
+ # To: the ID of the Broadcaster the Shoutout will be for
7
+ # Required scope: moderator:manage:shoutouts
8
+ def create(from:, to:, moderator_id:)
9
+ post_request("chat/shoutouts?from_broadcaster_id=#{from}&to_broadcaster_id=#{to}&moderator_id=#{moderator_id}", body: nil)
10
+ end
11
+
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Twitch
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/lib/twitch.rb CHANGED
@@ -44,6 +44,7 @@ module Twitch
44
44
  autoload :BlockedTermsResource, "twitch/resources/blocked_terms"
45
45
  autoload :CharityCampaignsResource, "twitch/resources/charity_campaigns"
46
46
  autoload :ChattersResource, "twitch/resources/chatters"
47
+ autoload :ShoutoutsResource, "twitch/resources/shoutouts"
47
48
 
48
49
 
49
50
  autoload :User, "twitch/objects/user"
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.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-02 00:00:00.000000000 Z
11
+ date: 2023-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -109,6 +109,7 @@ files:
109
109
  - lib/twitch/resources/predictions.rb
110
110
  - lib/twitch/resources/raids.rb
111
111
  - lib/twitch/resources/search.rb
112
+ - lib/twitch/resources/shoutouts.rb
112
113
  - lib/twitch/resources/stream_markers.rb
113
114
  - lib/twitch/resources/stream_schedule.rb
114
115
  - lib/twitch/resources/streams.rb
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubygems_version: 3.3.7
146
+ rubygems_version: 3.4.3
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: A Ruby library for interacting with the Twitch Helix API