Message object
Message
is an object that refers to a single message published on a chat channel.
Properties
The Message
object has the following properties:
Parameter | Type | Description |
---|---|---|
Timetoken | FString | Unique identifier for the message, possibly a timestamp or similar value that helps order messages in a conversation. |
MessageData | FPubnubChatMessageData | Additional data. |
→ Type | EPubnubChatMessageType | The type of the message. EPubnubChatMessageType::PCMT_TEXT by default. |
→ Text | FString | Original text content of the message. |
→ ChannelID | FString | Unique identifier for the channel or group in which the message was sent. |
→ UserID | FString | Unique ID of the user who sent the message. |
→ Meta | FString | Extra information added to the message giving additional context. This object can be of any type and can consist of a list of key-value pairs. For example, {language: 'English', wordCount: 42} . |
→ MessageActions | Array<FPubnubMessageAction> | Any actions associated with the message, such as reactions, replies, or other interactive elements. |
Methods
You can call the following methods on the Message
object.
Click on each method for more details.
CreateThread()
Delete()
Deleted()
EditText()
Forward()
GetTextLinks()
GetThread()
HasUserReaction()
ToggleReaction()
Pin()
QuotedMessage()
Reactions()
Report()
StreamUpdates()
StreamUpdatesOn()
Text()
TextLinks()
Use case
For example, you can use the Message
object methods to: