Skip to main content

Send location

Sends geographic coordinates to a chat or channel

Function SendLocation(Val Token, Val Latitude, Val Longitude, Val UserID, Val SendingToChannel) Export

ParameterCLI optionTypeDescription
Token--tokenStringToken
Latitude--latString, NumberGeographic latitude
Longitude--longString, NumberGeographic longitude
UserID--userString, NumberUser ID. For channel > administrator, for bot > recipient
SendingToChannel--ischannelBooleanSending to channel or bot chat

Returns: Map Of KeyAndValue - serialized JSON response from Viber


Code example
  
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
CLI command example
    
oint viber SendLocation --token %token% --lat %lat% --long %long% --user "d3jxe1111111111jYGgZg" --ischannel %ischannel%

Result
{
"billing_status": 1,
"chat_hostname": "SN-CHAT-10_",
"message_token": 5925751017338988046,
"status_message": "ok",
"status": 0
}