[**RongIMLib**](../README.md) *** [RongIMLib](../globals.md) / getTotalUnreadCountByLevels # Function: getTotalUnreadCountByLevels() > **getTotalUnreadCountByLevels**(`conversationTypes`, `levels`): `Promise`\<[`RCResult`](../interfaces/RCResult.md)\<`number`\>\> 获取会话指定免打扰级别的未读数 ## Parameters ### conversationTypes [`ConversationType`](../enumerations/ConversationType.md)[] 会话类型列表, ### levels [`NotificationLevel`](../enumerations/NotificationLevel.md)[] 需要获取的会话的免打扰级别,传空数组则统计全部支持会话未读数的会话类型的免打扰级别的未读数 ## Returns `Promise`\<[`RCResult`](../interfaces/RCResult.md)\<`number`\>\> 返回一个 [RCResult](../interfaces/RCResult.md) 类型 Promise,data 中返回会话未读数 ## Description 查找免打扰配置符合传入的免打扰级别的会话,返回所有会话中未读消息的总数 **注意**: 1. 聊天室会话类型不存储未读数,故不支持获取聊天室会话的未读数 ## Example 获取会话指定免打扰级别的未读数示例: ```ts const conversationTypes = [RongIMLib.ConversationType.PRIVATE]; const levels = [RongIMLib.NotificationLevel.ALL_MESSAGE]; const totalUnreadCount = await RongIMLib.getTotalUnreadCountByLevels(conversationTypes, levels); console.info('获取会话指定免打扰级别的未读数结果:', totalUnreadCount); ```