Skip to main content

Set DND by channel

Set DND level for a channel

Set the DND level for a specific channel by calling channel.setNoDisturbLevel(). Supports direct, group, and community channels.

Method

Dart
Future<int> setNoDisturbLevel(NoDisturbLevel level, ErrorHandler handler)

Parameters

ParameterTypeDescription
levelNoDisturbLevelDND level. See DND overview.
handlerErrorHandlerEvent callback.

Code example

Dart
final channel = DirectChannel('<target-user-id>');
await channel.setNoDisturbLevel(
NoDisturbLevel.blocked,
(error) {
if (error == null) {
print('DND level set');
}
},
);

Get DND level for a channel

Use channel.reload() to refresh channel data, then read channel.notificationLevel.

Get DND channel list

Use BaseChannel.getChannels() and filter by notificationLevel.