TIMGroupSearchGroups

Introduction

Search group info

It searches and returns all the groups matched the keywords in group_search_params_keyword_list. Maximum 5 keys.

Only locally stored groups can be searched for, such as the list of joined groups and group profiles that have been pulled.

You can set the search keyword group_search_params_keyword_list and specify the search scope to set whether to search by the userID and groupName fields of a group.

Parameter details

Parameter name Parameter type Required Description
searchGroupsParams SearchGroupParams yes Param of searching group info

Returned template

Promise<commonResult<Array<GroupInfo>>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: Array<GroupInfo> | undefined;
    json_params?: Array<GroupInfo> | 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< GroupInfo > | undefined Return value of calling API
json_params Array< GroupInfo > | 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 { GroupSearchParams, SearchGroupParams } from "im_electron_sdk/dist/interfaces";

let keyword = ''
let field = 0
let searchParams: GroupSearchParams = {
    group_search_params_keyword_list: [keyword],     // required
    group_search_params_field_list: [field]     // required
}

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

results matching ""

    No results matching ""