Skip to main content

Set DND by channel type

Set the DND level for a channel type

Set the DND level for all channels of a specific type with BaseChannel.setChannelTypeNoDisturbLevel().

Method

Dart
static Future<int> setChannelTypeNoDisturbLevel(ChannelTypeNotificationLevelParams params, ErrorHandler handler)

ChannelTypeNotificationLevelParams

PropertyTypeDescription
typeChannelTypeChannel type (e.g., ChannelType.direct, ChannelType.group)
levelNoDisturbLevelDND level: allMessage, none, mention, mentionUsers, mentionAll, blocked

Code example

Dart
await BaseChannel.setChannelTypeNoDisturbLevel(
ChannelTypeNotificationLevelParams(
type: ChannelType.direct,
level: NoDisturbLevel.blocked,
),
(error) {
if (error == null) {
print('Channel type DND set');
}
},
);