Telegram / Request and handle location

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!

Did this work?

did someone managed to achieve this ?

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)