tencent cloud

Chat

제품 소개
제품 개요
Basic Concepts
응용 시나리오
기능 소개
계정 시스템
사용자 정보 및 관계망
메시지 관리
그룹 시스템
Official Account
Audio/Video Call
사용 제한
구매 가이드
과금 개요
요금 안내
Purchase Instructions
Renewal Guide
연체 안내
Refund Policy
다운로드 센터
SDK & Demo 소스 코드
업데이트 로그
시나리오 솔루션
Live Streaming Setup Guide
AI Chatbot
대규모 엔터테인먼트 협업 커뮤니티
Discord 구현 가이드
IM을 게임에 통합하는 방법
WhatsApp Channel-style Official Account Integration Solution
Send Red Packet
Firewall Restrictions
클라이언트 APIs
SDK API(Web)
Android
iOS & macOS
Swift
Flutter
Electron
Unity
React Native
C APIs
C++
서버 APIs
Secure authentication with UserSig
RESTful APIs
Webhooks
콘솔 가이드
New Console Introduction
애플리케이션 생성 및 업그레이드
기본 설정
기능 설정
계정 관리
그룹 관리
Official Channel Management
콜백 설정
모니터링 대시보드
Viewing Guide for Resource Packages
Real-Time Monitor
개발 보조 툴
액세스 관리
Advanced Features
FAQ
uni-app FAQs
구매
SDK 관련 질문
계정 인증
사용자 정보 및 관계망
메시지
그룹
라이브 방송 그룹
닉네임 및 프로필 사진
협약 및 인증
Service Level Agreement
컴플라이언스 인증
IM 정책
개인 정보 보호 정책
데이터 개인 정보 보호 및 보안 계약
에러 코드
문의하기
문서Chat

React Native

포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-01-07 16:09:07

Getting the Profile of Group Members

Note:
1. TencentCloudChat.TYPES.GRP_AVCHATROOM (AVChatRoom) does not support this operation, error code 2687.
2. The maximum number of users in each query is 50. If the length of the array passed in is greater than 50, only the first 50 users will be queried, and the rest will be discarded.
API
chat.getGroupMemberProfile(options);
Parameters
The 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.
Return value
Promise
Examples
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);
});

Setting the Name Card of a Group Member

Note:
1. TencentCloudChat.TYPES.GRP_AVCHATROOM (AVChatRoom) does not support this operation, error code 2687.
2. Description of Operation Permissions:
Group Owner: Can set the namecard for all group members.
Administrator: Can set the namecard for themselves and other ordinary group members.
Ordinary Group Member: Can only set their own group namecard.
API
chat.setGroupMemberNameCard(options);
Parameters
The 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
Return value
Promise
Examples
let promise = chat.setGroupMemberNameCard({
groupID: 'group1',
userID: 'user1',
nameCard: 'Name card'
});
promise.then(function(imResponse) {
console.log(imResponse.data.group); // New group profile
console.log(imResponse.data.member); // New group member profile
}).catch(function(imError){
console.warn('setGroupMemberNameCard error:', imError);
});

Setting a Custom Group Member Field

Note:
1. TencentCloudChat.TYPES.GRP_AVCHATROOM (AVChatRoom) does not support this operation, error code 2687.
2. Ordinary group members can only set their own custom fields.
API
chat.setGroupMemberCustomField(options);
Parameters
The 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 field
value --- String --- Value of the custom field
Return value
Promise
Examples
let promise = chat.setGroupMemberCustomField({
groupID: 'group1',
memberCustomField: [{key: 'group_member_test', value: 'test'}]
});
promise.then(function(imResponse) {
console.log(imResponse.data.group); // New group profile
console.log(imResponse.data.member); // New group member profile
}).catch(function(imError){
console.warn('setGroupMemberCustomField error:', imError);
});

Marking Group Members

Note:
1. Only supports AVChatRoom and only the group owner has the permission to mark other members in the group.
2. Using this interface requires you to purchase the Premium edition.
API
chat.markGroupMemberList(options);
Parameters
The options parameter is of the Object type. It contains the following attribute values:
Name
Type
Description
groupID
String
Group ID or topic ID
userIDList
Array.<String>
List of group member userIDs, with a maximum of 500 group members per request.
markType
Number
Mark type. Greater than or equal to 1000, you can customize it. A maximum of 10 marks are allowed to be defined in an AVChatRoom.
Return value
Promise
Examples
let promise = chat.markGroupMemberList({
groupID: 'group1',
userIDList: ['user1', 'user2'],
markType: 1000,
enableMark: true,
});
promise.then(function(imResponse) {
const { successUserIDList, failureUserIDList } = imResponse.data;
}).catch(function(imError) {
console.warn('markGroupMemberList error:', imError);
});
// Get the list of online members with a specified mark in the AVChatRoom
let promise = chat.getGroupMemberList({ groupID: 'group1', filter: 1000, offset: 0 });
promise.then(function(imResponse) {
console.log(imResponse.data.memberList); // Group member list
}).catch(function(imError) {
console.warn('getGroupMemberList error:', imError);
});


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백