1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-16 11:38:11 +02:00
OpenIntegrations/docs/en/md/Telegram/Data-sending/Send-location.md
2024-06-04 21:55:01 +03:00

1.6 KiB

sidebar_position
8

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

Parameter CLI option Type Destination
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 Keyboard JSON or path to .json

Returns: Key-Value Pair - Serialized JSON response from Telegram

	
 Token = "6129457865:AAFyzNYOAFbu...";
 ChatID = "461699897";
 ChannelID = "@testsichee"; 
 Width = "48.87373649724122";
 Longitude = "48.87373649724122";
 
 Result = OPI_Telegram.SendLocation(Token, ChatID, Width, Longitude);
 
 OPI_TestDataRetrieval.WriteLog(Result, "SendLocation", "Telegram"); 
 
 
 Result = OPI_Telegram.SendLocation(Token, ChannelID, Width, Longitude);

	
 
 oint telegram SendLocation --token "6129457865:AAFyzNYOAFbu..." --chat "461699897" --lat %lat% --long "48.87373649724122" --keyboard %keyboard%


{
 "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
 }
 }
}