Updating messages

editMessageLiveLocation()

Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

parameters

parametertyperequireddescription
business_connection_idstringoptionalUnique identifier of the business connection on behalf of which the message to be edited was sent
chat_idnumber | stringoptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username.
message_idnumberoptionalRequired if inline_message_id is not specified. Identifier of the message to edit.
inline_message_idstringoptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.
latitudenumberrequiredLatitude of new location
longitudenumberrequiredLongitude of new location
live_periodnumberoptionalNew period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged.
horizontal_accuracynumberoptionalThe radius of uncertainty for the location, measured in meters; 0-1500
headingnumberoptionalDirection in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusnumberoptionalThe maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
reply_markupInlineKeyboardMarkupoptionalA JSON-serialized object for a new inline keyboard

returns

Message | boolean

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import type { EditMessageLiveLocationParams, Message } from "@yaebal/types";

await bot.api.call<Message | boolean>("editMessageLiveLocation", {
  latitude: 1,
  longitude: 1,
} satisfies EditMessageLiveLocationParams);

context shortcut

also available as ctx.editLiveLocation() on 16 context types — see @yaebal/contexts.

context shortcut
/** Use this method to edit live location messages. A location can be edited until its *live\_period* expires or editing is explicitly disabled by a call to [stopMessageLiveLocation](https://core.telegram.org/bots/api/#stopmessagelivelocation). On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. */
ctx.editLiveLocation(params: Omit<EditMessageLiveLocationParams, "chat_id" | "message_id">)