edit_message_live_location()

async Client.edit_message_live_location()

Edit a live location message.

A location can be edited until its live_period expires or editing is explicitly disabled by a call to stop_message_live_location().

Either chat_id + message_id or inline_message_id must be provided.

Usable by Users Bots
Parameters:
  • chat_id (int | str, optional) – Unique identifier (int) or username (str) of the target chat.

  • message_id (int, optional) – Identifier of the message to edit.

  • inline_message_id (str, optional) – Identifier of the inline message. Required when editing an inline live location.

  • latitude (float, optional) – New latitude of the location.

  • longitude (float, optional) – New longitude of the location.

  • live_period (int, optional) – New period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.

  • horizontal_accuracy (float, optional) – The radius of uncertainty for the location, measured in metres; 0-1500.

  • heading (int, optional) – Direction in which the user is moving, in degrees; 1-360.

  • proximity_alert_radius (int, optional) – The maximum distance for proximity alerts about approaching another chat member, in metres; 1-100000.

  • reply_markup (InlineKeyboardMarkup, optional) – An InlineKeyboardMarkup object. Pass None to remove the existing reply markup.

  • business_connection_id (str, optional) – Unique identifier of the business connection.

Returns:

Message | bool – On success, the edited Message is returned. For inline messages, True is returned.

Example

# Update a live location message
await app.edit_message_live_location(chat_id, message_id, latitude=37.7, longitude=-122.4)