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
| Level | Value | Description |
|---|---|---|
| None | 0 | All messages trigger notifications |
| Mentions only | 1 | Only @mentions trigger notifications |
| Blocked | 5 | No 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.