unbanChatMember method

Future<bool> unbanChatMember(
  1. dynamic chat_id,
  2. int user_id, {
  3. bool? only_if_banned,
})
inherited

Use this method to unban a previously kicked user in a supergroup or channel

The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. Returns True on success.

https://core.telegram.org/bots/api#unbanchatmember

Implementation

Future<bool> unbanChatMember(dynamic chat_id, int user_id,
    {bool? only_if_banned}) async {
  if (chat_id is! String && chat_id is! int) {
    return Future.error(TelegramException(
        'Attribute \'chat_id\' can only be either type of String or int'));
  }
  var requestUrl = _apiUri('unbanChatMember');
  var body = <String, dynamic>{
    'chat_id': chat_id,
    'user_id': user_id,
    'only_if_banned': only_if_banned,
  };
  return await HttpClient.httpPost(requestUrl, body: body);
}