getChatMemberCount method

Future<int> getChatMemberCount(
  1. dynamic chatId
)

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 chatId) async {
  if (chatId is! String && chatId is! int) {
    return Future.error(TelegramException(
        'Attribute \'chatId\' can only be either type of String or int'));
  }
  var requestUrl = _apiUri('getChatMemberCount');
  var body = <String, dynamic>{'chat_id': chatId};
  return await HttpClient.httpPost(requestUrl, body: body);
}