Closed FrancescoBOT closed 5 years ago
@Eleirbag89 do you know how to solve it?
Did you try to check for messages having the property location setted for the user ?
How can I see that?
Check in the webhook if
$telegram->Location();
has a value
No, it hasn't value. If I check the msg type I have this results: {"type":"edited_message"}
Maybe the edited messages contains the updated position ? can you post all the response object ?
Hi @Eleirbag89 but how can I get the response of a received message?
Usually i do
$bot_id = "XXXX";
$telegram = new Telegram($bot_id);
$data = $telegram->getData();
$log = fopen("log.txt", "w");
fwrite($log, $data);
fclose($log);
and then check the file log.txt after the webhook invocation
Hi @Eleirbag89 this is the response...so how do you suggest to get?
{"update_id":368209607,"edited_message":{"message_id":742,"from":{"id":41*17*33,"is_bot":false,"first_name":"Luca \uf8ff","username":"","language_code":"it"},"chat":{"id":41*17*33,"first_name":"Luca \uf8ff","username":"","type":"private"},"date":1550689346,"edit_date":1550689618,"location":{"latitude":37.540262,"longitude":15.085798}}}
I found the solution:
$data = $telegram->getData(); $position = $data["edited_message"]["location"]; $lat = $position["latitude"]; $lon = $position["longitude"];
If the user is manually sharing the live position with the bot, How can I receive / read the new position? thank you