Skip to main content

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:

FieldTypeDescription
groupIdstringGroup ID
groupNamestringGroup name
portraitUristringGroup portrait URL
membersCountnumberNumber 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);
}