Twitch.Cheer
WebSocket event schema, payload, and examples
message
object required
internal
boolean required
msgId
string
clientNonce
string
userId
string
username
string
role
integer required
Value | Name |
---|---|
0 | Unknown |
1 | Viewer |
2 | Vip |
3 | Moderator |
4 | Broadcaster |
subscriber
boolean required
subscriptionTier
string
displayName
string
color
string
channel
string
message
string
isHighlighted
boolean required
isMe
boolean required
isCustomReward
boolean required
isAnonymous
boolean required
isReply
boolean required
reply
object required
userId
string
userLogin
string
userName
string
msgId
string
msgBody
string
threadMsgId
string
threadUserLogin
string
bits
integer required
firstMessage
boolean required
returningChatter
boolean required
hasBits
boolean required
emotes
Emote[]
type
string
name
string
startIndex
integer required
endIndex
integer required
imageUrl
string
cheerEmotes
CheerEmote[]
type
string
name
string
startIndex
integer required
endIndex
integer required
imageUrl
string
bits
integer required
color
string
badges
Badge[]
name
string
version
string
imageUrl
string
info
string
monthsSubscribed
integer required
isTest
boolean required
isInSharedChat
boolean required
isFromSharedChatGuest
boolean required
sourceRoomId
string
sourceMsgId
string
sourceBadges
Badge[]
name
string
version
string
imageUrl
string
info
string
user
object required
id
string
login
string
name
string
type
string
role
integer required
Value | Name |
---|---|
0 | Unknown |
1 | Viewer |
2 | Vip |
3 | Moderator |
4 | Broadcaster |
badges
TwitchBadge[]
name
string
version
string
imageUrl
string
info
string
color
string
subscribed
boolean required
subscriptionTier
string
monthsSubscribed
integer required
messageId
string
meta
object required
internal
boolean required
clientNonce
string
firstMessage
boolean required
returningChatter
boolean required
isHighlighted
boolean required
isMe
boolean required
isCustomReward
boolean required
isTest
boolean required
anonymous
boolean required
text
string
emotes
Emote[]
type
string
name
string
startIndex
integer required
endIndex
integer required
imageUrl
string
parts
TwitchMessagePartBase[]
type
string
text
string
isReply
boolean required
reply
object required
msgId
string
userId
string
userLogin
string
userName
string
msgBody
string
threadMsgId
string
threadUserLogin
string
isTest
boolean required
sharedChatSource
object required
id
string
login
string
name
string
type
string
isInSharedChat
boolean required
isSharedChatHost
boolean required
isFromSharedChatGuest
boolean required
bits
integer required
cheerEmotes
CheerEmote[]
type
string
name
string
startIndex
integer required
endIndex
integer required
imageUrl
string
bits
integer required
color
string
Schema
The JSON Schema for the event payload, if available.
schema.json
{
"$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"
]
}
}
}
}
}
JSON Payload
An example JSON payload for the event, automatically generated using JSONSchemaFaker
example.json
{
"anonymous": false,
"bits": 43130971,
"cheerEmotes": [
{
"bits": 3181964,
"color": null,
"endIndex": -55267002,
"imageUrl": null,
"name": null,
"startIndex": -94801037,
"type": "elit ut ipsum ullamco sed"
},
{
"bits": 78886134,
"color": null,
"endIndex": -52293952,
"imageUrl": null,
"name": "nostrud enim",
"startIndex": 35808732,
"type": null
},
{
"bits": -13266366,
"color": null,
"endIndex": -50877355,
"imageUrl": null,
"name": null,
"startIndex": 26822132,
"type": null
},
{
"bits": 57966931,
"color": "ut Duis Excepteur",
"endIndex": 69938197,
"imageUrl": null,
"name": null,
"startIndex": 84147185,
"type": "labore nulla"
},
{
"bits": -52193397,
"color": null,
"endIndex": -27113479,
"imageUrl": "consectetur ut est elit",
"name": "cillum sunt mollit ex minim",
"startIndex": -53154874,
"type": null
}
],
"emotes": [
{
"endIndex": 94120884,
"imageUrl": "id",
"name": null,
"startIndex": -53804642,
"type": "pariatur aliqua"
},
{
"endIndex": 24189590,
"imageUrl": "cupidatat irure",
"name": "dolore mollit",
"startIndex": -67635503,
"type": null
},
{
"endIndex": 99097110,
"imageUrl": "sed",
"name": "sed sint aliquip ipsum anim",
"startIndex": -25341887,
"type": "minim magna nisi"
},
{
"endIndex": 20733809,
"imageUrl": null,
"name": null,
"startIndex": -71993532,
"type": null
},
{
"endIndex": -31945679,
"imageUrl": "eu adipisicing do ad",
"name": "eiusmod",
"startIndex": -34619824,
"type": "consectetur"
}
],
"isFromSharedChatGuest": true,
"isInSharedChat": true,
"isReply": true,
"isSharedChatHost": true,
"isTest": true,
"message": null,
"messageId": null,
"meta": null,
"parts": [
{
"text": "consectetur sunt dolor",
"type": "voluptate Lorem id magna ipsum"
},
{
"text": null,
"type": "fugiat aliquip"
},
{
"text": "dolore",
"type": null
},
{
"text": null,
"type": "reprehenderit dolor eiusmod"
},
{
"text": null,
"type": null
}
],
"reply": null,
"sharedChatSource": {
"id": null,
"login": "officia",
"name": null,
"type": "irure"
},
"text": null,
"user": {
"badges": null,
"color": "consectetur esse ut ad",
"id": null,
"login": "non laboris anim magna amet",
"monthsSubscribed": -86221767,
"name": "proident reprehenderit ea",
"role": 4,
"subscribed": false,
"subscriptionTier": null,
"type": null
}
}
Client Example
Example code showing how to subscribe to this event using the Streamer.bot WebSocket Client
index.js
// 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);
});