Get group info
Retrieve information about groups the current user has joined.
Get joined groups info
Use getJoinedGroups() to retrieve the groups you've joined:
TypeScript
import { GroupChannel } from '@nexconn/chat';
const { code, data: groups } = await GroupChannel.getJoinedGroups();
if (code === 0) {
console.log('Joined groups:', groups);
}
Each group in groups is a GroupInfo object with the following fields:
| Field | Type | Description |
|---|---|---|
groupId | string | Group ID |
groupName | string | Group name |
portraitUri | string | Group portrait URL |
membersCount | number | Number of members |
To get info for specific groups by ID, use GroupChannel.getGroupsInfo(groupIds):
TypeScript
import { GroupChannel } from '@nexconn/chat';
const { code, data: groups } = await GroupChannel.getGroupsInfo(['group1', 'group2']);
if (code === 0) {
console.log('Group info:', groups);
}