2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 5
|
|
|
|
---
|
|
|
|
|
2024-06-07 08:40:42 +02:00
|
|
|
# Send location
|
2024-06-05 12:19:46 +02:00
|
|
|
Sends geographic coordinates to a chat or channel
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function SendLocation(Val Token, Val Latitude, Val Longitude, Val UserID, Val SendingToChannel) Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| Latitude | --lat | String, Number | Geographic latitude |
|
|
|
|
| Longitude | --long | String, Number | Geographic longitude |
|
|
|
|
| UserID | --user | String, Number | User ID. For channel > administrator, for bot > recipient |
|
|
|
|
| SendingToChannel | --ischannel | Boolean | Sending to channel or bot chat |
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Viber
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
BotToken = "523b5b25ed27e6ec-111111111111111-2222222222222222";
|
|
|
|
UserID = "d3jxe1111111111jYGgZg==";
|
|
|
|
|
|
|
|
Response = OPI_Viber.SendLocation(BotToken, "55.75", "37.6167", UserID, False); //Map
|
|
|
|
Response = OPI_Tools.JSONString(Response); //JSON string
|
2024-06-05 12:19:46 +02:00
|
|
|
```
|
2024-08-13 14:52:26 +02:00
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
oint viber SendLocation --token %token% --lat %lat% --long %long% --user "d3jxe1111111111jYGgZg" --ischannel %ischannel%
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-08-13 14:52:26 +02:00
|
|
|
"billing_status": 1,
|
|
|
|
"chat_hostname": "SN-CHAT-10_",
|
|
|
|
"message_token": 5925751017338988046,
|
|
|
|
"status_message": "ok",
|
|
|
|
"status": 0
|
|
|
|
}
|
2024-06-05 12:19:46 +02:00
|
|
|
```
|