消息搜索选项。

interface MessageSearchOption {
    keywordList: readonly string[];
    keywordListMatchType?: MessageSearchKeywordMatchType;
    conversationId?: string;
    conversationType?: "singleChat" | "groupChat" | "chatRoom";
    msgTypes?: readonly SearchableMessageType[];
    startTime?: number;
    endTime?: number;
    searchScope?: MessageSearchScope;
    direction?: MessageSearchDirection;
}

Properties

keywordList: readonly string[]

搜索关键词列表。该参数必传,最多支持 5 个关键词,且每个关键词最长为 150 个字符。

keywordListMatchType?: MessageSearchKeywordMatchType

多关键词的匹配关系,默认值为 or

conversationId?: string

会话内搜索时的会话 ID。

conversationType?: "singleChat" | "groupChat" | "chatRoom"

会话类型过滤,需与 conversationId 配合使用。

msgTypes?: readonly SearchableMessageType[]

消息体类型过滤条件。不支持 audiocmd 类型。

startTime?: number

查询开始时间戳,单位为毫秒;需与 endTime 同时传入。

endTime?: number

查询结束时间戳,单位为毫秒;需与 startTime 同时传入。

searchScope?: MessageSearchScope

搜索范围。none 表示仅搜索消息体,with 表示搜索消息体和扩展字段,only 表示仅搜索扩展字段。

搜索方向。up 表示从旧消息到新消息,down 表示从新消息到旧消息。