chat.getGroupMemberProfile(options);
options
parameter is of the Object
type. It contains the following attribute values:Name | Type | Description |
groupID | String | Group ID |
userIDList | Array | List of IDs of the group members to be queried |
memberCustomFieldFilter | Array | undefined | Filtering the custom group member field. This attribute is optional. If it is not specified, all the custom group member fields are queried by default. |
Promise
let promise = chat.getGroupMemberProfile({groupID: 'group1',// Even if you retrieve the profile of only one group member, the value must be of array type// for example, userIDList: ['user1'].userIDList: ['user1', 'user2'],memberCustomFieldFilter: ['group_member_custom'],});promise.then(function(imResponse) {console.log(imResponse.data.memberList); // Group member list}).catch(function(imError){console.warn('getGroupMemberProfile error:', imError);});
chat.setGroupMemberNameCard(options);
options
parameter is of the Object
type. It contains the following attribute values:Name | Type | Description |
groupID | String | Group ID or topic ID |
userID | String | undefined | It is optional. By default, the user's own name card is modified. |
nameCard | String | Name card of a group member |
Promise
let promise = chat.setGroupMemberNameCard({groupID: 'group1',userID: 'user1',nameCard: 'Name card'});promise.then(function(imResponse) {console.log(imResponse.data.group); // New group profileconsole.log(imResponse.data.member); // New group member profile}).catch(function(imError){console.warn('setGroupMemberNameCard error:', imError);});
chat.setGroupMemberCustomField(options);
options
parameter is of the Object
type. It contains the following attribute values:Name | Type | Description |
groupID | String | Group ID or topic ID |
userID | String | undefined | Optional. If it is not specified, the user's own custom group member field is modified. |
memberCustomField | Array | Custom group member field. Its array elements are as structured below: key --- String --- Key of the custom fieldvalue --- String --- Value of the custom field |
Promise
let promise = chat.setGroupMemberCustomField({groupID: 'group1',memberCustomField: [{key: 'group_member_test', value: 'test'}]});promise.then(function(imResponse) {console.log(imResponse.data.group); // New group profileconsole.log(imResponse.data.member); // New group member profile}).catch(function(imError){console.warn('setGroupMemberCustomField error:', imError);});
Was this page helpful?