Skip to main content
Updates the user_defined field inside a specific message’s state. This provides a mechanism to store custom state on a message that will be reloaded if a thread is reloaded from history. The new data merges with existing data. When a thread loads, this data can be found on the message at message.message_state.content[<contentId>].user_defined.

Syntax

Parameters

string
required
The ID of the message to update.
string
required
The ID of the message content that must store the user_defined data.
unknown
required
The user-defined value to merge into the message state.

Returns

Returns a void operator.

Examples

The following example stores custom metadata on a message:

Do you need practical examples?

Learn how to apply the features available for embedded chat into your implementation with guidance and examples.