StaticGramBot API

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.

Поддерживается частично

chat messages only; inline messages → 400; business_connection_id: only messages this bot sent for the account

Параметры

business_connection_idStringнеобязательный
Unique identifier of the business connection on behalf of which the message to be edited was sent
chat_idInteger or Stringнеобязательный
Required 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_idIntegerнеобязательный
Required if inline_message_id is not specified. Identifier of the message to edit.
inline_message_idStringнеобязательный
Required if chat_id and message_id are not specified. Identifier of the inline message.
latitudeFloatобязательный
Latitude of new location
longitudeFloatобязательный
Longitude of new location
live_periodIntegerнеобязательный
New 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_accuracyFloatнеобязательный
The radius of uncertainty for the location, measured in meters; 0-1500
headingIntegerнеобязательный
Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerнеобязательный
The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
reply_markupInlineKeyboardMarkupнеобязательный
A JSON-serialized object for a new inline keyboard

Пример запроса

curl
curl "https://api.staticgram.top/bot$TOKEN/editMessageLiveLocation" \
  -H "Content-Type: application/json" \
  -d '{
    "latitude": 55.7558,
    "longitude": 37.6173
  }'
aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer

session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)

result = await bot.edit_message_live_location(latitude=55.7558, longitude=37.6173)
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/editMessageLiveLocation`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "latitude": 55.7558,
    "longitude": 37.6173
  }),
});
const data = await res.json();

Ответ (Message)

JSON
{
  "ok": true,
  "result": {
    "message_id": 1,
    "date": 1790000000,
    "chat": {
      "id": 1780243423,
      "type": "private"
    }
  }
}

Описания методов и типов взяты из официальной документации Telegram Bot API (Bot API 10.3). Адрес API: https://api.staticgram.top