TIMGroupModifyMemberInfo

Introduction

Modify group member info

Permission description

Only group owner or admin can modify member role.

AVChatRoom doesn't support modifing member role.

Only group owner or admin can mute member.

Use bit union to set multiple group_modify_member_info_modify_flag. Please check ModifyMemberInfoParams

By using this method, you can implement operations such as muting, setting administrators, and transferring group owners.

Parameter details

Parameter name Parameter type Required Description
modifyMemberInfoParams ModifyMemberInfoParams yes Param of modifying group member info

Returned template

Promise<commonResult<string>>

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

let groupId = ''
let identifier = ''
let flag = 0

let customInfo: GroupMemberInfoCustemString = {
    group_member_info_custom_string_info_key: '',// required
    group_member_info_custom_string_info_value: ''// required
}
let param: ModifyMemberInfoParams = {
    params: {
        group_modify_member_info_group_id: groupId, // required
        group_modify_member_info_identifier: identifier,// required
        group_modify_member_info_modify_flag: flag,// required
        group_modify_member_info_name_card: '',// optional
        group_modify_member_info_msg_flag: 0,// optional
        group_modify_member_info_member_role: 0,// optional
        group_modify_member_info_shutup_time: 0,// optional
        group_modify_member_info_custom_info: [customInfo],// optional
    },
    data: 'test data'
}
const { code } = await timRenderInstance.TIMGroupModifyMemberInfo(param)
if (code == 0) {
    // success
}

results matching ""

    No results matching ""