Get subchannels
Retrieve the list of subchannels within a community channel.
Get the subchannel list
TypeScript
import { CommunityChannel } from '@nexconn/chat';
const community = new CommunityChannel('<communityId>');
const { code, data } = await community.getSubChannels();
if (code === 0) {
console.log('Subchannels:', data);
} else {
console.log('Failed to get subchannels. Code:', code);
}
Response
Returns an array of CommunitySubChannel objects. Each contains:
| Property | Type | Description |
|---|---|---|
subChannelId | string | Subchannel ID |
channelId | string | Parent community channel ID |
subChannelType | CommunitySubChannelType | Visibility type of the subchannel (public or private) |
info
- The default
NCDefaultsubchannel is always included in the list. - Private subchannels are only visible to members of that subchannel.