sendVenue method

Future<Message> sendVenue(
  1. dynamic chat_id,
  2. double latitude,
  3. double longitude,
  4. String title,
  5. String address, {
  6. String? foursquare_id,
  7. String? foursquare_type,
  8. String? google_place_id,
  9. String? google_place_type,
  10. bool? disable_notification,
  11. int? reply_to_message_id,
  12. bool? allow_sending_without_reply,
  13. ReplyMarkup? reply_markup,
})
inherited

Use this method to send information about a venue

On success, the sent Message is returned.

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

Implementation

Future<Message> sendVenue(dynamic chat_id, double latitude, double longitude,
    String title, String address,
    {String? foursquare_id,
    String? foursquare_type,
    String? google_place_id,
    String? google_place_type,
    bool? disable_notification,
    int? reply_to_message_id,
    bool? allow_sending_without_reply,
    ReplyMarkup? reply_markup}) 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('sendVenue');
  var body = <String, dynamic>{
    'chat_id': chat_id,
    'latitude': latitude,
    'longitude': longitude,
    'title': title,
    'address': address,
    'foursquare_id': foursquare_id,
    'foursquare_type': foursquare_type,
    'google_place_id': google_place_id,
    'google_place_type': google_place_type,
    'disable_notification': disable_notification,
    'reply_to_message_id': reply_to_message_id,
    'allow_sending_without_reply': allow_sending_without_reply,
    'reply_markup': reply_markup == null ? null : jsonEncode(reply_markup),
  };
  return Message.fromJson(await HttpClient.httpPost(requestUrl, body: body));
}