getChatMemberCount method

Future<int> getChatMemberCount(
  1. dynamic chat_id
)
inherited

Use this method to get the number of members in a chat

Returns int on success.

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

Implementation

Future<int> getChatMemberCount(dynamic chat_id) 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('getChatMemberCount');
  var body = <String, dynamic>{'chat_id': chat_id};
  return await HttpClient.httpPost(requestUrl, body: body);
}