"@A @B @C......"
, which can be further edited before sent."someone@me"
or "@ all"
will be displayed to remind the user that the user was mentioned by someone in the group chat.Listening for the @ character for group member selection | Editing and sending the group @ message | Receiving the group @ message |
| | |
Cell
.createTextAtMessage
API to create a group @ message.sendMessage
to send the created @ message object.chat.createTextAtMessage(options);
options
parameter is of the Object
type. It contains the following attribute values:Name | Type | Description |
to | String | groupID of the message receiver |
conversationType | String | Conversation type, which must be TencentCloudChat.TYPES.CONV_GROUP |
payload | Object | Message content container |
cloudCustomData | String | Custom message data, which is saved in the cloud, will be sent to the receiver, and can still be pulled after the application is uninstalled and reinstalled. |
priority | String | Message priority. If messages in a group exceed the frequency limit, the backend will deliver high-priority messages first. Supported enumerated values: TencentCloudChat.TYPES.MSG_PRIORITY_HIGH TencentCloudChat.TYPES.MSG_PRIORITY_NORMAL (default) TencentCloudChat.TYPES.MSG_PRIORITY_LOW TencentCloudChat.TYPES.MSG_PRIORITY_LOWEST |
payload
is as described below:Name | Type | Description |
text | String | Message text content |
atUserList | Array.<String> | The list of users who need to be @mentioned. If you need to @ALL, please pass in TencentCloudChat.TYPES.MSG_AT_ALL . For example, suppose this text message wants to @mention denny and lucy, while also wanting to @mention everyone, atUserList would be passed as ['denny', 'lucy', TencentCloudChat.TYPES.MSG_AT_ALL] . |
Promise
let message = chat.createTextAtMessage({to: 'group1',conversationType: TencentCloudChat.TYPES.CONV_GROUP,payload: {text: '@denny @lucy Dinner gathering tonight, reply with 1 if you are coming.',atUserList: ['denny', 'lucy', TencentCloudChat.TYPES.MSG_AT_ALL] // 'denny' 'lucy' are both userID},// cloudCustomData: 'your cloud custom data'});let promise = chat.sendMessage(message);promise.then(function(imResponse) {console.log(imResponse);}).catch(function(imError) {console.warn('sendMessage error:', imError);});
Was this page helpful?