Is there a way to get user coordinates from telegram bot using Dialogflow?

人走茶凉 提交于 2019-12-25 01:26:02

问题


Currently im working on a telegram bot with Dialogflow. I want to get information about the user like current coordinates and user name but im not able to get them in the JSON coming from telegram. Is there a way to do such a thing without using any related google assistant events?


回答1:


You can check the structure of updates received by bot on the documentation Telegram Bot API

update.message.from contains the User object.

update.message.location contains the Location object.

Be aware that the location will be present only if the user actually sent his position to the bot, it will not be a metadata coming along with every message.



来源:https://stackoverflow.com/questions/56152226/is-there-a-way-to-get-user-coordinates-from-telegram-bot-using-dialogflow

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