How to find out whether it's user's current location or a chosen spot on map

若如初见. 提交于 2019-12-19 10:07:29

问题


I need to get user's current location.

I can ask for location by location keyboard and user will send his current location clicking on it. But he can also reply to message, choose any location on map and share it.

Either way, the returned results to my Bot are identical.(At least as I see.)

Is there a way or a trick to make sure that the shared location is also his current?

FYI - I'm using TeleBot library written in Node.js.(Even though I don't think it will affect the answer.)


回答1:


My workaround is I ask user send the location twice.

If two location are different. I will keep ask them to send new location.

Another solution is I create another inline bot which will create an Venue result which includes security check. The Venue is generate by the inline bot using current user location.

Anyway, I would like to use native telegram bot api to do that. Wish Telegram team add this feature in future.

Updates: Telegram 4.4 released a new feature - live location which is very difficult to cheat https://telegram.org/blog/live-locations




回答2:


There is no way to do that :(

I also have the same problem.



来源:https://stackoverflow.com/questions/43716042/how-to-find-out-whether-its-users-current-location-or-a-chosen-spot-on-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!