TIMGroupSearchGroupMembers

Introduction

Search group members

Only locally stored group members can be searched for, such as the list of group members or group member profiles that have been pulled.

It searches members in specified groups that match the keywordList's keyword in specified group info fields (namecard, nickname, remark, userID). Maximum number of keyword is 5.

If cannot search for the members, please invoke TIMGroupGetMemberInfoList to store the members into local storage. Then search again.

This feature cannot be used for audio-video groups (AVChatRoom) as the group members are not stored locally.

If group_search_member_params_groupid_list is left empty, members in all the groups will be searched for and returned by groupID.

If group_search_member_params_groupid_list is not left empty, members in the specified group will be searched for.

Parameter details

Parameter name Parameter type Required Description
searchMemberParams SearchMemberParams yes Param of searching group members

Returned template

Promise<commonResult<Array<SearchMemberResult>>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: Array<SearchMemberResult> | undefined;
    json_params?: Array<SearchMemberResult> | undefined; 
    user_data?: string | undefined;
}

Return value details

name type description
code TIMResultTIMErrCode Request result: Error codes. 0 means success.
desc string | undefined The description of the error. It will be empty if success.
json_param Array< SearchMemberResult > | undefined Return value of calling API
json_params Array< SearchMemberResult > | undefined Return value of calling API. Compatible field, which is returned in some cases.
user_data string | undefined ImSDK is responsible for transporting user-defined data without any processing

Code example

import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { SearchMemberParams, MemberSearchParams } from "im_electron_sdk/dist/interfaces";

let groupId = ''
let keyword = ''
let field = 0
let searchParams: MemberSearchParams = {
    group_search_member_params_groupid_list: [groupId], // required
    group_search_member_params_keyword_list: [keyword],// required
    group_search_member_params_field_list: [field]// required
}

let param: SearchMemberParams = {
    searchParams: searchParams,// required
    data: ''// optional
}
const { code } = await timRenderInstance.TIMGroupSearchGroupMembers(param)
if (code == 0) {
    // success
}

results matching ""

    No results matching ""