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
| Property | Type | Description |
|---|---|---|
type | ChannelType | Channel type (e.g., ChannelType.direct, ChannelType.group) |
level | NoDisturbLevel | DND 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');
}
},
);