Twitch.Cheer

WebSocket event schema, payload, and examples
The properties defined in the event schema, with descriptions.
anonymous
boolean required
bits
integer required
broadcaster
object required
cheerEmotes
CheerEmote[]
createdAt
string required
emotes
Emote[]
isFromSharedChatGuest
boolean required
isInSharedChat
boolean required
isReply
boolean required
isSharedChatHost
boolean required
isTest
boolean required
messageId
string
meta
object required
parts
array
reply
object required
sharedChatSource
object required
text
string
user
object required
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": {
    "user": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TwitchUser"
        }
      ]
    },
    "messageId": {
      "type": [
        "null",
        "string"
      ]
    },
    "meta": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TwitchMessageMetaData"
        }
      ]
    },
    "anonymous": {
      "type": "boolean"
    },
    "text": {
      "type": [
        "null",
        "string"
      ]
    },
    "emotes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/Emote"
      }
    },
    "parts": {
      "type": [
        "array",
        "null"
      ],
      "items": {}
    },
    "isReply": {
      "type": "boolean"
    },
    "reply": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TwitchMessageReply"
        }
      ]
    },
    "sharedChatSource": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TwitchBaseUser"
        }
      ]
    },
    "broadcaster": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TwitchBaseUser"
        }
      ]
    },
    "isInSharedChat": {
      "type": "boolean"
    },
    "isSharedChatHost": {
      "type": "boolean"
    },
    "isFromSharedChatGuest": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string"
    },
    "isTest": {
      "type": "boolean"
    },
    "bits": {
      "type": "integer"
    },
    "cheerEmotes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CheerEmote"
      }
    }
  },
  "$defs": {
    "TwitchUser": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "login": {
          "type": [
            "null",
            "string"
          ]
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "type": {
          "type": "string"
        },
        "role": {
          "$ref": "#/$defs/ViewerRole"
        },
        "badges": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/TwitchBadge"
          }
        },
        "color": {
          "type": [
            "null",
            "string"
          ]
        },
        "subscribed": {
          "type": "boolean"
        },
        "subscriptionTier": {
          "type": [
            "null",
            "string"
          ]
        },
        "monthsSubscribed": {
          "type": "integer"
        }
      }
    },
    "ViewerRole": {
      "type": "integer",
      "description": "",
      "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": {
        "isTest": {
          "type": "boolean"
        },
        "internal": {
          "type": "boolean"
        },
        "firstMessage": {
          "type": "boolean"
        },
        "firstMessageTimestamp": {
          "type": "string"
        },
        "returningChatter": {
          "type": "boolean"
        },
        "isHighlighted": {
          "type": "boolean"
        },
        "isMe": {
          "type": "boolean"
        },
        "isCustomReward": {
          "type": "boolean"
        }
      }
    },
    "Emote": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "Type": {
          "type": [
            "null",
            "string"
          ]
        },
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "StartIndex": {
          "type": "integer"
        },
        "EndIndex": {
          "type": "integer"
        },
        "ImageUrl": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "TwitchMessagePartCheerMote": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "source": {
          "type": [
            "null",
            "string"
          ]
        },
        "imageUrl": {
          "type": [
            "null",
            "string"
          ]
        },
        "zeroWidth": {
          "type": "boolean"
        },
        "type": {
          "type": "string"
        },
        "text": {
          "type": [
            "null",
            "string"
          ]
        },
        "bits": {
          "type": "integer"
        },
        "color": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "TwitchMessagePartEmote": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string"
        },
        "text": {
          "type": [
            "null",
            "string"
          ]
        },
        "source": {
          "type": [
            "null",
            "string"
          ]
        },
        "imageUrl": {
          "type": [
            "null",
            "string"
          ]
        },
        "zeroWidth": {
          "type": "boolean"
        }
      }
    },
    "TwitchMessagePartGif": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string"
        },
        "text": {
          "type": [
            "null",
            "string"
          ]
        },
        "gifId": {
          "type": [
            "null",
            "string"
          ]
        },
        "url": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "TwitchMessagePartMention": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string"
        },
        "text": {
          "type": [
            "null",
            "string"
          ]
        },
        "userId": {
          "type": [
            "null",
            "string"
          ]
        },
        "userLogin": {
          "type": [
            "null",
            "string"
          ]
        },
        "userName": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "TwitchMessagePartText": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "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": "string"
        }
      }
    },
    "CheerEmote": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "Type": {
          "type": [
            "null",
            "string"
          ]
        },
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "StartIndex": {
          "type": "integer"
        },
        "EndIndex": {
          "type": "integer"
        },
        "ImageUrl": {
          "type": [
            "null",
            "string"
          ]
        },
        "Bits": {
          "type": "integer"
        },
        "Color": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    }
  }
}
An example JSON payload for the event, automatically generated using JSONSchemaFaker
example.json
{
  "user": null,
  "messageId": null,
  "meta": {},
  "anonymous": false,
  "text": "uQrPGZHa2",
  "emotes": null,
  "parts": [
    {},
    -264.1534279100597,
    {},
    "",
    false
  ],
  "isReply": false,
  "reply": null,
  "sharedChatSource": null,
  "broadcaster": null,
  "isInSharedChat": false,
  "isSharedChatHost": true,
  "isFromSharedChatGuest": true,
  "createdAt": "ZzCEJ",
  "isTest": false,
  "bits": 711,
  "cheerEmotes": [
    {
      "Type": "82SP7",
      "Name": null,
      "StartIndex": -868,
      "EndIndex": 75,
      "ImageUrl": null,
      "Bits": 80,
      "Color": null
    },
    {
      "Type": "Uk7N",
      "Name": "",
      "StartIndex": -175,
      "EndIndex": -691,
      "ImageUrl": "998K26",
      "Bits": 627,
      "Color": "yLiNHp2d0f"
    },
    {
      "Type": "",
      "Name": null,
      "StartIndex": -424,
      "EndIndex": 987,
      "ImageUrl": null,
      "Bits": -990,
      "Color": "ZQYhlh"
    },
    {
      "Type": "Tt6f7m",
      "Name": null,
      "StartIndex": -125,
      "EndIndex": 103,
      "ImageUrl": "",
      "Bits": -74,
      "Color": null
    },
    {
      "Type": null,
      "Name": null,
      "StartIndex": -794,
      "EndIndex": -630,
      "ImageUrl": "0xduqihz",
      "Bits": -537,
      "Color": "x733s"
    }
  ]
}
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);
});