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 optionTypeDescription
Token--tokenStringBot token
ChatID--chatString, NumberTarget chat ID or ChatID*TopicID
Latitude--latString, NumberGeographic latitude
Longitude--longString, NumberGeographic longitude
Keyboard--keyboardStringKeyboard JSON or path to .json

Returns: Map Of KeyAndValue - Serialized JSON response from Telegram


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);
CLI command example
    
oint telegram SendLocation --token "6129457865:AAFyzNYOAFbu..." --chat "461699897" --lat %lat% --long "48.87373649724122" --keyboard %keyboard%

Result
{
"ok": true,
"result": {
"message_id": 4646,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Vitaly The Bot",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titowets",
"username": "JKIee",
"type": "private"
},
"date": 1717072442,
"location": {
"latitude": 48.873739,
"longitude": 48.873733
}
}
}