"@A @B @C......"
, which can be further edited before sent.
In the group chat list of the receiver's conversation UI, the identifier "someone@me"
or "@ all"
will be displayed to remind the user that the user was mentioned by someone in the group chat.Message
object, while the nickname is to be displayed in the text box.MsgSendMessage
API (details) to create a text @ message, create the Message
message object, specify the target group members, and send the message object.// Create a group @ messagevar message = new Message{message_conv_id = conv_id,message_conv_type = TIMConvType.kTIMConv_Group,message_elem_array = new List<Elem>{new Elem{elem_type = TIMElemType.kTIMElem_Text,text_elem_content = Input.text}},| message_group_at_user_array | UserID list of users that need to be mentioned (@) in the group message. To @all, pass in the `kImSDK_MesssageAtALL` field. |};StringBuilder messageId = new StringBuilder(128);TIMResult res = TencentIMSDK.MsgSendMessage(conv_id, TIMConvType.kTIMConv_Group, message, messageId, (int code, string desc, string json_param, string user_data)=>{// Async message sending result});
conv_group_at_info_array
API (details) of ConvInfo
to get the @ data list of the conversation.conv_group_at_info_at_type
API (details) of the GroupAtInfo
object in the list to get the @ data type and update it to the @ information of the current conversation.TIMResult res = TencentIMSDK.ConvGetConvList((int code, string desc, List<ConvInfo> info_list, string user_data)=>{foreach (ConvInfo info in info_list){foreach (GroupAtInfo at_info in info.conv_group_at_info_array){if (at_info.conv_group_at_info_at_type == TIMGroupAtType.kTIMGroup_At_Me) {// @me}if (at_info.conv_group_at_info_at_type == TIMGroupAtType.kTIMGroup_At_All) {// @all in the group}if (at_info.conv_group_at_info_at_type == TIMGroupAtType.kTIMGroup_At_All_At_ME) {// @all in the group and @me alone}}}});
Was this page helpful?