Skip to main content

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:

PropertyTypeDescription
subChannelIdstringSubchannel ID
channelIdstringParent community channel ID
subChannelTypeCommunitySubChannelTypeVisibility type of the subchannel (public or private)
info
  • The default NCDefault subchannel is always included in the list.
  • Private subchannels are only visible to members of that subchannel.