Send location
Sends location by geographic latitude and longitude to a chat or channel
- Parameters
- Advanced call ?
Function SendLocation(Val Token, Val ChatID, Val Latitude, Val Longitude, Val Keyboard = "") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Bot token |
| ChatID | --chat | String, Number | ✔ | Target chat ID or ChatID*TopicID |
| Latitude | --lat | String, Number | ✔ | Geographic latitude |
| Longitude | --long | String, Number | ✔ | Geographic longitude |
| Keyboard | --keyboard | String, Structure Of KeyAndValue | ✖ | Keyboard. See FormKeyboardFromButtonArray |
Returns
Map Of KeyAndValue - serialized JSON response from Telegram
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete structure with fields code, body, and headers |
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);
- Bash
- CMD/Bat
oint telegram SendLocation \
--token "***" \
--chat "***" \
--lat "48.87373649724122" \
--long "48.87373649724122"
oint telegram SendLocation ^
--token "***" ^
--chat "***" ^
--lat "48.87373649724122" ^
--long "48.87373649724122"
Result
{
"ok": true,
"result": {
"message_id": 21162,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titovets",
"username": "bayselonarrend",
"type": "private"
},
"date": 1777720740,
"location": {
"latitude": 48.873739,
"longitude": 48.873733
}
}
}