leaveChat method
Use this method for your bot to leave a group, supergroup or channel
Returns True on success.
Implementation
Future<bool> leaveChat(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('leaveChat');
var body = <String, dynamic>{'chat_id': chatId};
return await HttpClient.httpPost(requestUrl, body: body);
}