twitchrb 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +8 -0
- data/lib/twitch/objects/chat_message.rb +4 -0
- data/lib/twitch/resources/chat_messages.rb +8 -1
- data/lib/twitch/version.rb +1 -1
- data/lib/twitch.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efe6dbb90fcec7a7f5ce13ca4b812349bfa16ff95140b30ba344b2b352d5176c
|
4
|
+
data.tar.gz: 7e954ca5c0f4462e35d9950af57d43da72871ac708398dc97561912a8ae535c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9438a27de32ba91ea58e3a95ab705e0138d5274ba61274c1c190d1b88d1e2003d3171fcfdbaecdb230434b05db384ec200e8b49c90f7ced6096d2c2ef4967c49
|
7
|
+
data.tar.gz: 20c286d14a3dfa432deec04f62864bf70282e124d346b2594f769021db3bca4c768319614a7689b9756b33bd224507f8f503fd7e7e5e302a9f7ef37dc1b1f24c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -317,7 +317,15 @@ These require an application OAuth access token.
|
|
317
317
|
@client.raids.delete broadcaster_id: 123
|
318
318
|
```
|
319
319
|
|
320
|
+
### Chat Messages
|
321
|
+
|
320
322
|
```ruby
|
323
|
+
# Send a chat message to a broadcaster's chat room
|
324
|
+
# Requires an app or user access token that includes user:write:chat then either user:bot or channel:bot
|
325
|
+
# sender_id must be the currently authenticated user
|
326
|
+
# reply_to is optional and is the UUID of the message to reply to
|
327
|
+
@client.chat_messages.create broadcaster_id: 123, sender_id: 321, message: "A test message", reply_to: "aabbcc"
|
328
|
+
|
321
329
|
# Removes a single chat message from the broadcaster's chat room
|
322
330
|
# Requires moderator:manage:chat_messages
|
323
331
|
# moderator_id can be either the currently authenticated moderator or the broadcaster
|
@@ -1,6 +1,13 @@
|
|
1
1
|
module Twitch
|
2
2
|
class ChatMessagesResource < Resource
|
3
|
-
|
3
|
+
|
4
|
+
def create(broadcaster_id:, sender_id:, message:, reply_to: nil)
|
5
|
+
attrs = {broadcaster_id: broadcaster_id, sender_id: sender_id, message: message, reply_parent_message_id: reply_to}
|
6
|
+
|
7
|
+
response = post_request("chat/messages", body: attrs)
|
8
|
+
ChatMessage.new(response.body.dig("data")[0])
|
9
|
+
end
|
10
|
+
|
4
11
|
# moderator_id must match the user in the OAuth token
|
5
12
|
def delete(broadcaster_id:, moderator_id:, message_id:)
|
6
13
|
delete_request("moderation/chat?broadcaster_id=#{broadcaster_id}&moderator_id=#{moderator_id}&message_id=#{message_id}")
|
data/lib/twitch/version.rb
CHANGED
data/lib/twitch.rb
CHANGED
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.
|
4
|
+
version: 1.2.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: 2024-01-
|
11
|
+
date: 2024-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/twitch/objects/channel.rb
|
58
58
|
- lib/twitch/objects/channel_editor.rb
|
59
59
|
- lib/twitch/objects/charity_campaign.rb
|
60
|
+
- lib/twitch/objects/chat_message.rb
|
60
61
|
- lib/twitch/objects/chatter.rb
|
61
62
|
- lib/twitch/objects/clip.rb
|
62
63
|
- lib/twitch/objects/custom_reward.rb
|