getChatMember method

Future<ChatMember> getChatMember(
  1. dynamic chat_id,
  2. int user_id
)
inherited

Use this method to get information about a member of a chat

Returns a ChatMember object on success.

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

Implementation

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