SDKsWASM
Create an @ message
Create a group-chat text message with @ mentions using the WASM SDK.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Message body. Stable markers such as @userID are recommended. |
atUserIDList | string[] | Yes | IDs of the mentioned users. Use the SDK's AtAllTag to mention everyone. |
atUsersInfo | AtUserInfo[] | No | User IDs and their display names within the group. |
message | MessageItem | No | Original message being referenced. |
const { data: message } = await openimsdk.createTextAtMessage({
text: '@user_a please confirm',
atUserIDList: ['user_a'],
atUsersInfo: [{ atUserID: 'user_a', groupNickname: 'Alex' }],
});When the Promise resolves, it returns only a pending message object. This message can be sent only to a group chat. Creating it does not change the conversation's @ state or trigger a new-message event.
Was this page helpful?