Telegram
You are viewing documentation for our open source project which is maintained by the community. If you want to get started building assistants with Rasa please check out our latest documentation here.
Getting Credentials
How to get the Telegram credentials:
You need to set up a Telegram bot.
To create the bot, go to Bot Father, enter
/newbotand follow the instructions. The URL that Telegram should send messages to will look likehttp://<host>:<port>/webhooks/telegram/webhook, replacing the host and port with the appropriate values from your running Rasa X or Rasa Open Source server.At the end you should get your
access_tokenand the username you set will be yourverify.If you want to use your bot in a group setting, it's advisable to turn on group privacy mode by entering
/setprivacy. Then the bot will only listen when a user's message starts with/bot.
For more information, check out the Telegram HTTP API.
Running on Telegram
Add the Telegram credentials to your credentials.yml:
telegram:
access_token: "490161424:AAGlRxinBRtKGb21_rlOEMtDFZMXBl6EC0o"
verify: "your_bot"
webhook_url: "https://your_url.com/webhooks/telegram/webhook"
Restart your Rasa X or Rasa Open Source server to make the new channel endpoint available for Telegram to send messages to.
Supported Response Attachments
Changed in 1.10
Support for additional responses was added.
In addition to standard text: responses, this channel also supports the following components from the Telegram API:
buttonarguments:- button_type: inline | vertical | reply
customarguments:- photo
- audio
- document
- sticker
- video
- video_note
- animation
- voice
- media
- latitude, longitude (location)
- latitude, longitude, title, address (venue)
- phone_number
- game_short_name
- action
Examples:
utter_ask_transfer_form_confirm:
buttons:
- payload: /affirm
title: Yes
- payload: /deny
title: No, cancel the transaction
button_type: vertical
text: Would you like to transfer {currency}{amount_of_money} to {PERSON}?
image: "https://i.imgur.com/nGF1K8f.jpg"
utter_giraffe_sticker:
text: Here's my giraffe sticker!
custom:
sticker: "https://github.com/TelegramBots/book/raw/master/src/docs/sticker-fred.webp"