banChatMember method

Future<bool> banChatMember(
  1. ChatID chatId,
  2. int userId, {
  3. int? untilDate,
  4. bool? revokeMessages,
})
inherited

Use this method to ban a user in a group, a supergroup or a channel.

In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first.

The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

Returns True on success.

Implementation

Future<bool> banChatMember(
  ChatID chatId,
  int userId, {
  int? untilDate,
  bool? revokeMessages,
}) {
  return _client.apiCall(_token, 'banChatMember', {
    'chat_id': chatId,
    'user_id': userId,
    'until_date': untilDate,
    'revoke_messages': revokeMessages,
  });
}