Barrage

data class Barrage(var liveID: String = "", var sender: LiveUserInfo = LiveUserInfo(), var sequence: Long = 0, var timestampInSecond: Long = 0, var messageType: BarrageType = BarrageType.TEXT, var textContent: String = "", var extensionInfo: Map<String, String> = emptyMap(), var businessID: String = "", var data: String = "")

Barrage data model, containing complete attribute information of a single barrage.

Overview

Contains complete information about the barrage sender, content, type, etc.

Property Overview

PropertyTypeDescription
liveIDStringUnique identifier ID of the live room/voice chat room the barrage belongs to
senderLiveUserInfoUser information of the barrage sender
sequenceLongUnique sequence ID of the barrage message
timestampInSecondLongBarrage sending timestamp (unit: seconds)
messageTypeBarrageTypeBarrage message type (text or custom)
textContentStringMessage content of text type barrage
extensionInfoMap<String, String>Barrage extension information
businessIDStringBusiness identifier ID of custom type barrage
dataStringSpecific data content of custom type barrage

Constructors

Link copied to clipboard
constructor(liveID: String = "", sender: LiveUserInfo = LiveUserInfo(), sequence: Long = 0, timestampInSecond: Long = 0, messageType: BarrageType = BarrageType.TEXT, textContent: String = "", extensionInfo: Map<String, String> = emptyMap(), businessID: String = "", data: String = "")

Properties

Link copied to clipboard

Business identifier ID of custom type barrage, used to distinguish custom barrages from different business scenarios.

Link copied to clipboard

Specific data content of custom type barrage (usually JSON format string), valid when messageType is CUSTOM.

Link copied to clipboard

Barrage extension information, customizable fields (such as display style, priority, etc.). Valid when messageType is TEXT.

Link copied to clipboard

Unique identifier ID of the live room/voice chat room the barrage belongs to.

Link copied to clipboard

Barrage message type (text or custom).

Link copied to clipboard

User information of the barrage sender (such as user ID, nickname, avatar, etc.).

Link copied to clipboard

Unique sequence ID of the barrage message, used for message sorting and deduplication.

Link copied to clipboard

Message content of text type barrage, i.e., the text content of the barrage.

Link copied to clipboard

Barrage sending timestamp (unit: seconds), used to display sending time order.