Search code examples
dialogflow-estelegramtelegram-botpython-telegram-botdialogflow-es-fulfillment

Is there any way to send a location to a telegram bot via Dialogflow?


I am trying to create a telegram bot that can return a list of location to a telegram bot. As dialogflow does'nt allow us to send a location back to the telegram through default implementation,I was trying to use a custom payload to send back the location.However it isnt working.

{
"fulfillmentMessages": [
     {
        "text": {
          "text": [
            "Lellox"
          ]
        }
     },
     {
        "payload": {
                  "telegram": 
          {
            "text": "Please share your contact",
            "location": {"longitude": 2.294489, "latitude": 48.858252}
   
          }
        },
        "platform": "TELEGRAM"
     },
]
}

Solution

  • I haven't been able to achieve sending a location object back to telegram.

    However, I've found a workaround that could be useful that consist in using a URL of a Google Maps location, check it:

    {
      "telegram": {
        "text": "Location [here](https://goo.gl/maps/JPiw6zHjiyUvo7dDA).",
        "parse_mode": "Markdown"
      }
    }