TwurpleAuthenticationGetting dataExamplesFAQMigration

ChatMessage

A regular chat message.

Overview

Properties

bits

Type: number

The number of bits cheered with the message.

channelId

Type: string | null

The ID of the channel the message is in.

date

Type: Date

The date the message was sent at.

emoteOffsets

Type: Map<string, string[]>

The offsets of emote usages in the message.

hypeChatAmount

Type: number | null

The amount of money that was sent for Hype Chat, specified in the currency’s minor unit, or null if the message is not a Hype Chat.

For example, the minor units for USD is cents, so if the amount is $5.50 USD, value is set to 550.

hypeChatCurrency

Type: string | null

The ISO-4217 three-letter currency code that identifies the currency used for Hype Chat, or null if the message is not a Hype Chat.

hypeChatDecimalPlaces

Type: number | null

The number of decimal places used by the currency used for Hype Chat, or null if the message is not a Hype Chat.

For example, USD uses two decimal places. Use this number to translate hypeChatAmount from minor units to major units by using the formula:

value / 10^decimalPlaces

hypeChatIsSystemMessage

Value: false | true | null

Whether the system filled in the message for the Hype Chat (because the user didn't type one), or null if the message is not a Hype Chat.

hypeChatLevel

Type: number | null

The level of the Hype Chat, or null if the message is not a Hype Chat.

hypeChatLocalizedAmount

Type: number | null

The localized amount of money sent for Hype Chat, based on the value and the decimal places of the currency, or null if the message is not a Hype Chat.

For example, the minor units for USD is cents which uses two decimal places, so if value is 550, localizedValue is set to 5.50.

id

Type: string

The ID of the message.

isCheer

Type: boolean

Whether the message is a cheer.

isFirst

Type: boolean

Whether the message is the first message of the chatter who sent it.

isHighlight

Type: boolean

Whether the message is highlighted by using channel points.

isHypeChat

Type: boolean

Whether the message is a Hype Chat.

isRedemption

Type: boolean

Whether the message represents a redemption of a custom channel points reward.

isReply

Type: boolean

Whether the message is a reply to another message.

isReturningChatter

Type: boolean

Whether the message is sent by a returning chatter.

Twitch defines this as a new viewer who has chatted at least twice in the last 30 days.

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.

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.

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.

userInfo

Type: ChatUser

Info about the user that send the message, like their user ID and their status in the current channel.