Telegram / Request and handle location - Rasa Open Source - Rasa Community Forum
post by maland on Mar 19, 2019
Hi all,
Based on Telegram Bot API documentation Telegram Bot API I created an action where I want to request a user location. But unfortunately I don’t get anything on a user side after this action call.
from rasa_core_sdk import Action
class ActionGetLocation(Action):
def name(self):
return "action_get_location"
def run(self, dispatcher, tracker, domain):
dispatcher.utter_custom_message({"text": "Can i get your location please?",
"reply_markup": { "keyboard": [[{ "text": "Send Location", "request_location": "true"}]]}})
return []
Does anyone know or had any experience how to request a user location in Telegram? Or any other messenger platforms?
Thanks a lot for any ideas!
post by GauravRoy48 on Sep 27, 2019
Did this work?
post by M_R_LY on Nov 4, 2021
did someone managed to achieve this ?
post by InnoOmnia on Nov 4, 2021
install and use this
GitHub - python-telegram-bot/python-telegram-bot: We have made you a wrapper you can't refuse
and then
modify this to Rasa “format”
dispatcher.add_handler(MessageHandler(Filters.location, location))
def location(bot, update):
print(update.message.location)
post by haydn04 on Apr 10
I faced this question before. And I figured we just need an intent and train it in nlu.yml. I forget how is the text and you can print the full_message of the latest message and find the ‘text:’ and copy the format to the nlu.yml. I maybe it is too late to help you but hope it can help others in the future.
I found the problem and explained below. Hope you see my message and hope you are still working on your project.