EventSubChannelChatMessageEvent
An EventSub event representing a notification being sent to a channel's chat.
Overview
Properties
- badges
- bits
- broadcasterDisplayName
- broadcasterId
- broadcasterName
- chatterDisplayName
- chatterId
- chatterName
- color
- isCheer
- isRedemption
- messageId
- messageParts
- messageText
- messageType
- parentMessageId
- parentMessageText
- parentMessageUserDisplayName
- parentMessageUserId
- parentMessageUserName
- rewardId
- sourceBadges
- sourceBroadcasterDisplayName
- sourceBroadcasterId
- sourceBroadcasterName
- sourceMessageId
- threadMessageId
- threadMessageUserDisplayName
- threadMessageUserId
- threadMessageUserName
Properties
badges
Type: Record<string, string>
The badges the chatter has.
The returned object contains the badge names as keys and the badge versions as the respective values.
isRedemption
Type: boolean
Whether the message represents a redemption of a custom channel points reward.
messageParts
Type: EventSubChatMessagePart[]
The text that was sent with the notification, structured into pre-parsed parts.
messageText
Type: string
The text that was sent with the notification, e.g. the resub message or announcement text.
parentMessageId
Type: string | null
The ID of the message that this message is a reply to, or null
if it's not a reply.
parentMessageText
Type: string | null
The text of the message that this message is a reply to, or null
if it's not a reply.
parentMessageUserDisplayName
Type: string | null
The display name of the user that wrote the message that this message is a reply to, or null
if it's not a reply.
parentMessageUserId
Type: string | null
The ID of the user that wrote the message that this message is a reply to, or null
if it's not a reply.
parentMessageUserName
Type: string | null
The name of the user that wrote the message that this message is a reply to, or null
if it's not a reply.
rewardId
Type: string | null
The ID of the redeemed reward, or null
if the message does not represent a redemption.
sourceBadges
Type: Record<string, string> | null
The chat badges for the chatter in the channel the message was sent from.
The returned object contains the badge names as keys and the badge versions as the respective values.
This only applies if a chatter sends a chat message in another channel's chat during a shared chat session.
Is null
when the message happens in the same channel as the broadcaster.
sourceBroadcasterDisplayName
Type: string | null
The display name of the broadcaster from whose channel the message was sent.
This only applies if a chatter sends a chat message in another channel's chat during a shared chat session.
Is null
when the message happens in the same channel as the broadcaster.
sourceBroadcasterId
Type: string | null
The ID of the broadcaster from whose channel the message was sent.
This only applies if a chatter sends a chat message in another channel's chat during a shared chat session.
Is null
when the message happens in the same channel as the broadcaster.
sourceBroadcasterName
Type: string | null
The name of the broadcaster from whose channel the message was sent.
This only applies if a chatter sends a chat message in another channel's chat during a shared chat session.
Is null
when the message happens in the same channel as the broadcaster.
sourceMessageId
Type: string | null
The UUID that identifies the source message from the channel the message was sent from.
This only applies if a chatter sends a chat message in another channel's chat during a shared chat session.
Is null
when the message happens in the same channel as the broadcaster.
threadMessageId
Type: string | null
The ID of the message that is the thread starter of this message, or null
if it's not a reply.
threadMessageUserDisplayName
Type: string | null
The display name of the user that wrote the thread starter message of this message, or null
if it's not a reply.
threadMessageUserId
Type: string | null
The ID of the user that wrote the thread starter message of this message, or null
if it's not a reply.
threadMessageUserName
Type: string | null
The name of the user that wrote the thread starter message of this message, or null
if it's not a reply.
Methods
getBadgeInfo(name)
Gets the badge info for a specified badge, or null if the badge does not exist.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
name | string | none | The name of the badge to get info for. |
getSourceBadgeInfo(name)
Gets the badge info for a specified badge.
This only applies if a chatter sends a chat message in another channel's chat during a shared chat session.
Is null
when the message happens in the same channel as the broadcaster, or if the badge does not exist.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
name | string | none | The name of the badge to get info for. |
hasBadge(name)
Checks whether the chatter has the specified badge.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
name | string | none | The name of the badge to check. |
hasSourceBadge(name)
Checks whether the chatter has the specified badge.
This only applies if a chatter sends a chat message to another chat during a shared chat session.
Is null
when the message happens in the same channel as the broadcaster.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
name | string | none | The name of the badge to check. |