TIMGroupModifyGroupInfo

Introduction

Modify group info

Group owner change permission description

Only group owner has the right to transfer group.

AVChatRoom does not support group transfer.

Other group info change permission description

Only group owner or admin can modify group introduction for Public/Meeting group or AVChatRoom.

Anyone can modify group introduction in Private group.

Use bit union to set multiple group_modify_info_param_modify_flag, please check ModifyGroupParams

Call GroupModifyGroupInfo to modify the group profile. When the modification is complete, all group members receive the GroupTipsEventCallback callback.

Parameter details

Parameter name Parameter type Required Description
modifyGroupParams ModifyGroupParams yes Param of modifying group 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 { ModifyGroupParams, GroupInfoCustemString } from "im_electron_sdk/dist/interfaces";
let groupId = ''

let customString: GroupInfoCustemString = {
    group_info_custom_string_info_key: '',   // required
    group_info_custom_string_info_value: ''   // required
}

let param: ModifyGroupParams = {
    params: {
        group_modify_info_param_group_id: groupId,   // required
        group_modify_info_param_modify_flag: 1,   // required
        group_modify_info_param_notification: '',   // optional
        group_modify_info_param_group_name: '',   // optional
        group_modify_info_param_introduction: '',   // optional
        group_modify_info_param_face_url: '',   // optional
        group_modify_info_param_add_option: 0,   // optional
        group_modify_info_param_max_member_num: 0,   // optional
        group_modify_info_param_visible: 0,   // optional
        group_modify_info_param_searchable: 0,   // optional
        group_modify_info_param_is_shutup_all: false,   // optional
        group_modify_info_param_owner: '',   // optional
        group_modify_info_param_custom_info: [customString]   // optional
    },
    data: 'test data'
}
const { code } = await timRenderInstance.TIMGroupModifyGroupInfo(param)
if (code == 0) {
    // success
}

results matching ""

    No results matching ""