Skip to content

Twitch.ChatMessage

A chat message.

  • Platform: twitch
  • Shape: chat
  • Source event: Twitch.ChatMessage
Widget.on("Twitch.ChatMessage", (event) => {
// event.user, event.platform…
});
  • user (string): Display name; «Anonymous» for anonymous gifts.
  • userId (string): User id on its platform.
  • userLogin (string): Login, lowercase.
  • color (string): Name color (#RRGGBB) or empty.
  • role (1 | 2 | 3 | 4): 1 viewer, 2 VIP, 3 moderator, 4 broadcaster.
  • badges (ChatBadge[]): Badges, with their image.
  • message (string): The message, as plain text.
  • parts (MessagePart[]): The message in parts (text, emotes and cheers), for Widget.dom.renderMessage.
  • messageId (string): Message id; the one messageDeleted carries.
  • firstMessage (boolean): First message in the channel.
  • highlighted (boolean): Highlighted with channel points.
  • reply (ChatReply | null): Who it replies to, or null.

It also carries platform (the source platform) and raw (the original payload).

The example payload that reaches the Studio simulator:

{
"user": {
"role": 3,
"badges": [
{
"name": "lead_moderator",
"version": "1",
"imageUrl": "https://static-cdn.jtvnw.net/badges/v1/0822047b-65e0-46f2-94a9-d1091d685d33/3",
"info": ""
}
],
"color": "#FFFFFF",
"subscribed": false,
"monthsSubscribed": 0,
"id": "100000002",
"login": "lunagamer",
"name": "LunaGamer",
"type": "twitch"
},
"messageId": "00000000-0000-4000-8000-000000000001",
"meta": {
"internal": false,
"firstMessage": false,
"firstMessageTimestamp": "2026-08-07T18:01:06.5712172-06:00",
"returningChatter": false,
"isHighlighted": false,
"isMe": false,
"isCustomReward": false,
"isInSharedChat": false,
"isSharedChatHost": false,
"isFromSharedChatGuest": false,
"createdAt": "2026-09-26T05:32:11.8891229Z",
"isTest": false
},
"anonymous": false,
"text": "¡Hola desde el simulador!",
"emotes": [],
"parts": [
{
"type": "text",
"text": "¡Hola desde el simulador!"
}
],
"isReply": false,
"reply": null,
"sharedChatSource": null,
"broadcaster": {
"id": "100000000",
"login": "canaldeprueba",
"name": "CanalDePrueba",
"type": "twitch"
},
"isInSharedChat": false,
"isSharedChatHost": false,
"isFromSharedChatGuest": false,
"createdAt": "2026-09-26T05:32:11.8891229Z",
"isTest": false
}