We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 202fc0f + 9222c09 commit 3ecaf77Copy full SHA for 3ecaf77
1 file changed
tts/twitch/index.js
@@ -31,4 +31,17 @@ export class Twitch extends EventTarget {
31
body: JSON.stringify(data)
32
})
33
}
34
-}
+ async sendMessage(broadcaster_user_id, message) {
35
+ return fetch(`https://api.twitch.tv/helix/chat/messages?broadcaster_id=${broadcaster_user_id}&moderator_id=${this.user_id}`, {
36
+ method: 'POST',
37
+ headers: {
38
+ 'Content-Type': 'application/json',
39
+ Authorization: this.token,
40
+ 'Client-Id': this.client_id
41
+ },
42
+ body: JSON.stringify({
43
+ message: message
44
+ })
45
46
+ }
47
+}
0 commit comments