Get Live Location
Closed this issue · 6 comments
swim89 commented
Hi!
I would to implement the possibility to send the current location of the user by the BOT and I would to save it in a DB.
Do you know which is the best way to do it?
makasim commented
according to the bot api you have to use request_location keyboard button.
https://core.telegram.org/bots/api#keyboardbutton
This part is not implemented yet but should be fairly easy to add, just like request_contacts
swim89 commented
I tried it but it is for one-time request...not for live location...right?
makasim commented
I dont know
swim89 commented
I found the solution:
$data = $telegram->getData(); $position = $data["edited_message"]["location"];
$lat = $position["latitude"];
$lon = $position["longitude"];
makasim commented
It would be great if you could open a PR with these additions. Would you?
Fabiobreo commented
Does it work?