banUser method

Future<void> banUser({
  1. required String userId,
  2. int seconds = -1,
  3. String? description,
})

Bans a user from this channel.

Provides seconds to set how long the user should be banned. -1 indicates to ban the user parmanently.

Implementation

Future<void> banUser({
  required String userId,
  int seconds = -1,
  String? description,
}) async {
  if (userId.isEmpty) {
    throw InvalidParameterError();
  }

  await _sdk.api.send(ChannelUserBanRequest(
    targetId: userId,
    channelType: channelType,
    channelUrl: channelUrl,
    description: description,
    seconds: seconds,
  ));
}