i am developping a bot and i want to link it with telegram. I want to use custom button in order to ask location , i saw in the documentation that its possible with the custom arguments but there is no more information about how to use it or examples. It will be great if someone could help me with an example ! I want a button that when the user click on it, it send the user’s location i saw that its possible to do it with some keyboardbutton but i am having trouble with it i am using python and the last version of rasa
Usefull link for the documentation : telegram api keyboard button , Rasa's documentation for telegram connector , python-telegram-bot , rasa dispatcher
Code that i have tried 1 :
location_keyboard = telegram.KeyboardButton(text="send_location", request_location=True)
contact_keyboard = telegram.KeyboardButton(text="send_contact", request_contact=True)
custom_keyboard = [[ location_keyboard, contact_keyboard ]]
reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard)
dispatcher.utter_message(text="loc",buttons= location_keyboard)
2 : b=JSONDict.stringify({"keyboard": [ [{ "text": "Location", "request_location": True }], [{ "text": "Contact", "request_contact": True }] ], "one_time_keyboard" : True}) dispatcher.utter_message(json_message=b)