Live location (Telegram)
To trigger an event, the user needs to start broadcasting the geoposition in Telegram (Live location Telegram).
Live location in Telegram can be used when it is important to know the location of the bot user in real time.
To create the Live location (Telegram) event, go to Settings ➝ Events and click Add Event. Enter the Name of the event and select the Type — Live location (Telegram).
Set the variable which will get the coordinates of the location. An object containing latitude (lat variable) and longitude (long variable) will be written to this variable. The variable livePeriod will be written to the same object, which will contain the time of broadcast in seconds. The user chooses this time independently when he starts the Live location.
Select the screen that will come to the user when he starts the event.
To delete an event, click the Delete button.
Send Live location to the bot.
To Live location, click on the paperclip icon to the right of the Telegram input line, select Location, then Live my location.
After that, specify how long your location will be transmitted to the bot, then click Share.
When a user sends a Live location, in addition to latitude and longitude (lat and long), the livePeriod variable is also passed to the bot. It distinguishes the Live location from the usual sending of a location.
If the user stops the Live location before the specified time, Telegram will send only latitude and longitude to the bot at the time of the stop, without livePeriod. Thus, the bot will treat this message as a normal location.
The event, in this case, will not be called again.
Make sure that the bot will be able to process the message correctly if the user stops the Live location earlier than it was announced.