[**RongIMLib**](../README.md) *** [RongIMLib](../globals.md) / clearHistoryMessages # Function: clearHistoryMessages() > **clearHistoryMessages**(`conversation`, `timestamp`): `Promise`\<[`RCResult`](../interfaces/RCResult.md)\<`void`\>\> 按时间戳删除消息 ## Parameters ### conversation [`IConversationIdentifier`](../interfaces/IConversationIdentifier.md) 会话 ### timestamp `number` 清除时间点,该时间之前的消息将被清除 ## Returns `Promise`\<[`RCResult`](../interfaces/RCResult.md)\<`void`\>\> ## Description 根据时间戳删除指定单个会话中早于(含)指定时间戳的所有消息。 ## Example 按时间戳删除消息示例: ```ts const conversation = { conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId', } const timestamp = 1632728573423; const clearRes = await RongIMLib.clearHistoryMessages(conversation, timestamp); console.info('清除消息结果:', clearRes); ```