TencentCloudChat.EVENT.CONVERSATION_LIST_UPDATED
event.chat.pinConversation(options);
options
parameter is of the Object
type. It contains the following attribute values:Name | Type | Description |
conversationID | String | Conversation ID, which consists of: C2C${userID} (for one-to-one chats) GROUP{groupID} (for group chats) @TIM#SYSTEM (system notification conversation) GROUP${topicID} (topic) |
isPinned | Boolean | true , the conversation is pinned to the topfalse , the conversation is unpinned from the top |
Promise
// Pin a conversation to toplet promise = chat.pinConversation({ conversationID: 'C2CExample', isPinned: true });promise.then(function(imResponse) {// The conversation is pinned to top successfully.const { conversationID } = imResponse.data; // ID of the conversation pinned to top}).catch(function(imError){console.warn('pinConversation error:', imError); // Error information});
// Unpin a conversation from toplet promise = chat.pinConversation({ conversationID: 'C2CExample', isPinned: false });promise.then(function(imResponse) {// The conversation is unpinned from top successfully.const { conversationID } = imResponse.data; // ID of the conversation unpinned from top}).catch(function(imError){console.warn('pinConversation error:', imError); // Error information});
Was this page helpful?