Skip to content

sendLocation

Sahri Riza Umami edited this page Jun 22, 2018 · 4 revisions

Send a message with a location.

sendLocation(chat_id, reply_to_message_id, latitude, longitude, disable_notification, from_background, reply_markup)
Field Type Description
chat_id int53 Target chat.
reply_to_message_id int53 Identifier of the message to reply to.
latitude double Latitude of the location in degrees; as defined by the sender.
longitude double Longitude of the location in degrees; as defined by the sender
disable_notification Bool Pass true to disable notification for the message. Not supported in secret chats.
from_background Bool Pass true if the message is sent from the background.
reply_markup ReplyMarkup Markup for replying to the message; for bots only.

Example

  • Send message with location latitude -7.88393 and longitude 112.524 to chat 1234567890.

    sendLocation(1234567890, 0, -7.88393, 112.524)

    Response:

    {
      ["@type"] = "message",
      author_signature = "",
      can_be_deleted_for_all_users = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = false,
      can_be_forwarded = true,
      chat_id = "1234567890",
      contains_unread_mention = false,
      content = {
        ["@type"] = "messageLocation",
        expires_in = 0,
        live_period = 0,
        location = {
          ["@type"] = "location",
          latitude = -7.88393,
          longitude = 112.524
        }
      },
      date = 1529658211,
      edit_date = 0,
      id = "16064184329",
      is_channel_post = false,
      is_outgoing = true,
      media_album_id = "0",
      reply_to_message_id = 0,
      sender_user_id = 88888888,
      sending_state = {
        ["@type"] = "messageSendingStatePending"
      },
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 0,
      views = 0
    }  

Frequently Asked Questions
The Functions

Clone this wiki locally