How to change button_type in telegram - Rasa Open Source - Rasa Community Forum
How to change button_type in telegram
post by Seven7O7 on Feb 1, 2020
Hi! I want to change button_type (used in telegram.py) to vertical, but I don’t know how? Can I custom it without change anything from telegram.py file?
My credentials.yml
telegram:
access_token: "........."
verify: "....."
webhook_url: "https://66267744.ngrok.io/webhooks/telegram/webhook"
My domain.yml
utter_mobile_devices_configuration_more_info:
- text: Quizás te interese
buttons:
- title: Medidas
payload: /request_mobile_devices_configuration_actions
- title: No, gracias
payload: /deny
post by Gehova on Feb 4, 2020
I couldn’t find a way to change that, the problem is that CollectingDispatcher has to be generic and work with all the channels.
If all your buttons are vertical, copy the contents of telegram.py into a new file like custom_channel.py in your bot folder and change the default button_type in send_text_with_buttons to “vertical”. Modify your credentials.yml as:
custom_channel.TelegramInput:
access_token: "..."
verify: ".."
webhook_url: ".../webhooks/telegram/webhook"
PS: An advantage of doing this, is that you can further implement more functionality from the telegram api, like sending local files.
post by Akhil on Jun 4, 2020
Hi, There is a very simple way. You can use custom: key in domain.yml and do it in this way. Reference: Domains
domain.yml
utter_mobile_devices_configuration_more_info:
- custom:
channel: "telegram"
text: Quizás te interese
button_type: vertical
buttons:
- title: Medidas
payload: /request_mobile_devices_configuration_actions
- title: No, gracias
payload: /deny
In this way, no need to change anything in telegram.py file.