Skip to main content

Send location

Sends location by geographic latitude and longitude to a chat or channel

Function SendLocation(Val Token, Val ChatID, Val Latitude, Val Longitude, Val Keyboard = "") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringBot token
ChatID--chatString, NumberTarget chat ID or ChatID*TopicID
Latitude--latString, NumberGeographic latitude
Longitude--longString, NumberGeographic longitude
Keyboard--keyboardStringKeyboard. See FormKeyboardFromButtonArray

Returns: Map Of KeyAndValue - serialized JSON response from Telegram


tip

Method at API documentation: sendLocation


1C:Enterprise/OneScript code example
    Token     = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
ChannelID = "@testsichee";
Width = "48.87373649724122";
Longitude = "48.87373649724122";

Result = OPI_Telegram.SendLocation(Token, ChatID, Width, Longitude);

Result = OPI_Telegram.SendLocation(Token, ChannelID, Width, Longitude);
    oint telegram SendLocation \
--token "***" \
--chat "@testsichee" \
--lat "48.87373649724122" \
--long "48.87373649724122"
Result
{
"ok": true,
"result": {
"message_id": 8312,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titowets",
"username": "JKIee",
"type": "private"
},
"date": 1728453427,
"location": {
"latitude": 48.873739,
"longitude": 48.873733
}
}
}