Hello, I’m am Reinier, a Cuban that lives in Rio de Janeiro sorry to bother you people. I am very excited with RASA an all the features that it have, thanks to all of you for all the posts I read on the community forum. But there is something that takes away my sleep. I am developing a Telegram FAQ chat-bot and I need to use custom actions a lot ( mostly I use sender_id and the text of the message itself). Sadly, there is no way to get the telegram user_name inside the custom action. There is any way to include the user_name on the tracker object? Thanks
Hi @reiniermn welcome! The sender_id should be the telegram user name no? Otherwise you’ll have to use the telegram api to extract it in a custom action
Sorry for the delay. It is not the same thing (sender_id and username). For instance check this example of a request coming from a telegram bot.
{‘update_id’: 455336560, ‘message’: {‘message_id’: 19060, ‘from’: {‘id’: 888888888, ‘is_bot’: False, ‘first_name’: ‘Jonh’, ‘last_name’: ‘Doe’, ‘username’: ‘johndoe’, ‘language_code’: ‘pt-br’}, ‘chat’: {‘id’: 888888888, ‘first_name’: ‘Jonh’, ‘last_name’: ‘Doe’, ‘username’: ‘johndoe’, ‘type’: ‘private’}, ‘date’: 1564582289, ‘text’: ‘hello’}}
The tracker object on the custom action only get the sender_id (“id” in the above request) and the message text. It would be nice to naturally get the username inside the custom action via the tracker object. The advantage: can be used (if required) to define permissions at the back-end to avoid users get responses for questions above their authority level