Skip to main content

Set default DND for a community

Set DND for a community channel (current user)

TypeScript
import { CommunityChannel } from '@nexconn/chat';

const community = new CommunityChannel('<communityId>');
const { code } = await community.setNoDisturbLevel(5); // 5 = blocked
if (code === 0) {
console.log('DND set for community');
}

Set DND for a community subchannel (current user)

TypeScript
import { CommunitySubChannel } from '@nexconn/chat';

const channel = new CommunitySubChannel('<communityId>', '<subChannelId>');
const { code } = await channel.setNoDisturbLevel(5);
if (code === 0) {
console.log('DND set for subchannel');
}

DND levels

LevelValueDescription
None0All messages trigger notifications
Mentions only1Only @mentions trigger notifications
Blocked5No notifications at all
info

User-level DND settings affect only the current user. To configure default DND for all community members, use the Server API.