Twitch.Cheer| Value | Name |
|---|---|
| 0 | Unknown |
| 1 | Viewer |
| 2 | Vip |
| 3 | Moderator |
| 4 | Broadcaster |
| Value | Name |
|---|---|
| 0 | Unknown |
| 1 | Viewer |
| 2 | Vip |
| 3 | Moderator |
| 4 | Broadcaster |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "TwitchCheerEvent",
"type": "object",
"additionalProperties": false,
"properties": {
"message": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/definitions/ChatMessage"
}
]
},
"user": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/definitions/TwitchUser"
}
]
},
"messageId": {
"type": [
"null",
"string"
]
},
"meta": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/definitions/TwitchMessageMetaData"
}
]
},
"anonymous": {
"type": "boolean"
},
"text": {
"type": [
"null",
"string"
]
},
"emotes": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Emote"
}
},
"parts": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/TwitchMessagePartBase"
}
},
"isReply": {
"type": "boolean"
},
"reply": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/definitions/TwitchMessageReply"
}
]
},
"isTest": {
"type": "boolean"
},
"sharedChatSource": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/definitions/TwitchBaseUser"
}
]
},
"isInSharedChat": {
"type": "boolean"
},
"isSharedChatHost": {
"type": "boolean"
},
"isFromSharedChatGuest": {
"type": "boolean"
},
"bits": {
"type": "integer",
"format": "int32"
},
"cheerEmotes": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/CheerEmote"
}
}
},
"definitions": {
"ChatMessage": {
"type": "object",
"additionalProperties": false,
"properties": {
"internal": {
"type": "boolean"
},
"msgId": {
"type": [
"null",
"string"
]
},
"clientNonce": {
"type": [
"null",
"string"
]
},
"userId": {
"type": [
"null",
"string"
]
},
"username": {
"type": [
"null",
"string"
]
},
"role": {
"$ref": "#/definitions/ViewerRole"
},
"subscriber": {
"type": "boolean"
},
"subscriptionTier": {
"type": [
"null",
"string"
]
},
"displayName": {
"type": [
"null",
"string"
]
},
"color": {
"type": [
"null",
"string"
]
},
"channel": {
"type": [
"null",
"string"
]
},
"message": {
"type": [
"null",
"string"
]
},
"isHighlighted": {
"type": "boolean"
},
"isMe": {
"type": "boolean"
},
"isCustomReward": {
"type": "boolean"
},
"isAnonymous": {
"type": "boolean"
},
"isReply": {
"type": "boolean"
},
"reply": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/definitions/ReplyData"
}
]
},
"bits": {
"type": "integer",
"format": "int32"
},
"firstMessage": {
"type": "boolean"
},
"returningChatter": {
"type": "boolean"
},
"hasBits": {
"type": "boolean"
},
"emotes": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Emote"
}
},
"cheerEmotes": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/CheerEmote"
}
},
"badges": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Badge"
}
},
"monthsSubscribed": {
"type": "integer",
"format": "int32"
},
"isTest": {
"type": "boolean"
},
"isInSharedChat": {
"type": "boolean"
},
"isFromSharedChatGuest": {
"type": "boolean"
},
"sourceRoomId": {
"type": [
"null",
"string"
]
},
"sourceMsgId": {
"type": [
"null",
"string"
]
},
"sourceBadges": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Badge"
}
}
}
},
"ViewerRole": {
"type": "integer",
"description": "",
"x-enum-names": [
"Unknown",
"Viewer",
"Vip",
"Moderator",
"Broadcaster"
],
"x-enum-varnames": [
"Unknown",
"Viewer",
"Vip",
"Moderator",
"Broadcaster"
],
"x-enumNames": [
"Unknown",
"Viewer",
"Vip",
"Moderator",
"Broadcaster"
],
"x-enum-descriptions": [
null,
null,
null,
null,
null
],
"x-enumDescriptions": [
null,
null,
null,
null,
null
],
"enum": [
0,
1,
2,
3,
4
]
},
"ReplyData": {
"type": "object",
"additionalProperties": false,
"properties": {
"userId": {
"type": [
"null",
"string"
]
},
"userLogin": {
"type": [
"null",
"string"
]
},
"userName": {
"type": [
"null",
"string"
]
},
"msgId": {
"type": [
"null",
"string"
]
},
"msgBody": {
"type": [
"null",
"string"
]
},
"threadMsgId": {
"type": [
"null",
"string"
]
},
"threadUserLogin": {
"type": [
"null",
"string"
]
}
}
},
"Emote": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"startIndex": {
"type": "integer",
"format": "int32"
},
"endIndex": {
"type": "integer",
"format": "int32"
},
"imageUrl": {
"type": [
"null",
"string"
]
}
}
},
"CheerEmote": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"startIndex": {
"type": "integer",
"format": "int32"
},
"endIndex": {
"type": "integer",
"format": "int32"
},
"imageUrl": {
"type": [
"null",
"string"
]
},
"bits": {
"type": "integer",
"format": "int32"
},
"color": {
"type": [
"null",
"string"
]
}
}
},
"Badge": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"version": {
"type": [
"null",
"string"
]
},
"imageUrl": {
"type": [
"null",
"string"
]
},
"info": {
"type": [
"null",
"string"
]
}
}
},
"TwitchUser": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": [
"null",
"string"
]
},
"login": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
},
"role": {
"$ref": "#/definitions/ViewerRole2"
},
"badges": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/TwitchBadge"
}
},
"color": {
"type": [
"null",
"string"
]
},
"subscribed": {
"type": "boolean"
},
"subscriptionTier": {
"type": [
"null",
"string"
]
},
"monthsSubscribed": {
"type": "integer",
"format": "int32"
}
}
},
"ViewerRole2": {
"type": "integer",
"description": "",
"x-enum-names": [
"Unknown",
"Viewer",
"Vip",
"Moderator",
"Broadcaster"
],
"x-enum-varnames": [
"Unknown",
"Viewer",
"Vip",
"Moderator",
"Broadcaster"
],
"x-enumNames": [
"Unknown",
"Viewer",
"Vip",
"Moderator",
"Broadcaster"
],
"x-enum-descriptions": [
null,
null,
null,
null,
null
],
"x-enumDescriptions": [
null,
null,
null,
null,
null
],
"enum": [
0,
1,
2,
3,
4
]
},
"TwitchBadge": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"version": {
"type": [
"null",
"string"
]
},
"imageUrl": {
"type": [
"null",
"string"
]
},
"info": {
"type": [
"null",
"string"
]
}
}
},
"TwitchMessageMetaData": {
"type": "object",
"additionalProperties": false,
"properties": {
"internal": {
"type": "boolean"
},
"clientNonce": {
"type": [
"null",
"string"
]
},
"firstMessage": {
"type": "boolean"
},
"returningChatter": {
"type": "boolean"
},
"isHighlighted": {
"type": "boolean"
},
"isMe": {
"type": "boolean"
},
"isCustomReward": {
"type": "boolean"
},
"isTest": {
"type": "boolean"
}
}
},
"TwitchMessagePartBase": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": [
"null",
"string"
]
},
"text": {
"type": [
"null",
"string"
]
}
}
},
"TwitchMessageReply": {
"type": "object",
"additionalProperties": false,
"properties": {
"msgId": {
"type": [
"null",
"string"
]
},
"userId": {
"type": [
"null",
"string"
]
},
"userLogin": {
"type": [
"null",
"string"
]
},
"userName": {
"type": [
"null",
"string"
]
},
"msgBody": {
"type": [
"null",
"string"
]
},
"threadMsgId": {
"type": [
"null",
"string"
]
},
"threadUserLogin": {
"type": [
"null",
"string"
]
}
}
},
"TwitchBaseUser": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": [
"null",
"string"
]
},
"login": {
"type": [
"null",
"string"
]
},
"name": {
"type": [
"null",
"string"
]
},
"type": {
"type": [
"null",
"string"
]
}
}
}
}
}
{
"anonymous": true,
"bits": -76493023,
"cheerEmotes": [
{
"bits": 33324905,
"color": "Excepteur",
"endIndex": -23091530,
"imageUrl": null,
"name": null,
"startIndex": -54134104,
"type": null
},
{
"bits": -12594952,
"color": "aliquip",
"endIndex": -75885994,
"imageUrl": "nisi Excepteur",
"name": null,
"startIndex": -88868464,
"type": "sunt laborum et in ex"
},
{
"bits": -86756254,
"color": "consectetur aliquip in",
"endIndex": 93714840,
"imageUrl": null,
"name": null,
"startIndex": 35529515,
"type": "dolore in qui veniam deserunt"
},
{
"bits": -20957314,
"color": null,
"endIndex": 77789748,
"imageUrl": null,
"name": "ea sunt laboris",
"startIndex": 17481238,
"type": null
},
{
"bits": -98834407,
"color": "et pariatur aliqua ad occaecat",
"endIndex": -89455701,
"imageUrl": "ex adipisicing ullamco elit",
"name": null,
"startIndex": -1302239,
"type": null
}
],
"emotes": [
{
"endIndex": -30027328,
"imageUrl": null,
"name": null,
"startIndex": -85973876,
"type": null
},
{
"endIndex": 76389218,
"imageUrl": "esse dolor labore",
"name": "sit aliquip nisi sed",
"startIndex": 53296421,
"type": null
},
{
"endIndex": -56911676,
"imageUrl": "ipsum irure mollit",
"name": null,
"startIndex": -10613278,
"type": null
},
{
"endIndex": -56046638,
"imageUrl": null,
"name": null,
"startIndex": -38797681,
"type": null
},
{
"endIndex": -81217330,
"imageUrl": null,
"name": null,
"startIndex": 1184548,
"type": null
}
],
"isFromSharedChatGuest": true,
"isInSharedChat": true,
"isReply": true,
"isSharedChatHost": false,
"isTest": false,
"message": {
"badges": null,
"bits": -26253821,
"channel": "cupidatat sit dolor aute",
"cheerEmotes": [
{
"bits": -33598569,
"color": null,
"endIndex": -77317664,
"imageUrl": null,
"name": "elit",
"startIndex": 63938632,
"type": null
},
{
"bits": -50994174,
"color": "Excepteur officia enim",
"endIndex": -10748441,
"imageUrl": "minim esse",
"name": "in esse",
"startIndex": 71305507,
"type": "Ut voluptate in"
},
{
"bits": 98120577,
"color": "tempor commodo sunt dolor Lorem",
"endIndex": -79091664,
"imageUrl": "labore anim",
"name": null,
"startIndex": -62753571,
"type": null
},
{
"bits": 11200872,
"color": null,
"endIndex": -99864012,
"imageUrl": null,
"name": null,
"startIndex": -59501145,
"type": null
},
{
"bits": -37664430,
"color": null,
"endIndex": 46504568,
"imageUrl": "culpa Excepteur aliqua ut",
"name": null,
"startIndex": 94236941,
"type": null
}
],
"clientNonce": null,
"color": "pariatur est sed",
"displayName": "dolore laborum fugiat pariatur elit",
"emotes": null,
"firstMessage": false,
"hasBits": true,
"internal": true,
"isAnonymous": true,
"isCustomReward": false,
"isFromSharedChatGuest": false,
"isHighlighted": true,
"isInSharedChat": true,
"isMe": false,
"isReply": true,
"isTest": false,
"message": "velit dolor",
"monthsSubscribed": -91619470,
"msgId": "deserunt qui dolore",
"reply": null,
"returningChatter": true,
"role": 4,
"sourceBadges": null,
"sourceMsgId": null,
"sourceRoomId": "in",
"subscriber": false,
"subscriptionTier": null,
"userId": null,
"username": null
},
"messageId": null,
"meta": {
"clientNonce": "Duis eiusmod",
"firstMessage": false,
"internal": false,
"isCustomReward": true,
"isHighlighted": true,
"isMe": true,
"isTest": true,
"returningChatter": true
},
"parts": [
{
"text": null,
"type": null
},
{
"text": "id",
"type": null
},
{
"text": null,
"type": null
},
{
"text": "est",
"type": null
},
{
"text": "nostrud esse",
"type": "in cupidatat ea exercitation commodo"
}
],
"reply": {
"msgBody": null,
"msgId": "non in aute magna",
"threadMsgId": null,
"threadUserLogin": "id velit elit",
"userId": null,
"userLogin": null,
"userName": null
},
"sharedChatSource": null,
"text": null,
"user": null
}
// Initialize the Streamer.bot WebSocket Client
const client = new StreamerbotClient();
// Subscribe to "Twitch.Cheer" events and register a callback
client.on('Twitch.Cheer', ({ event, data }) => {
// Code here will run every time the event is received!
console.log('Received event:', event.source, event.type);
console.log('Event data:', data);
});