This deck is a guide to create a Hello World! Telegram ChatBot that is powered by Google Dialogflow.
Here is a demo bot on Telegram, just for fun.
https://t.me/EthanWoof_Bot
1. Creating a “Hello World!”
Telegram ChatBot
Getting Started
Ng Chong Yang
B.Eng (Hons, 1st), DipELN, Dip.M (CIM), MIEEE, FCIM
Email: bot@ethanwoof.com
Ethan Woof - A Telegram Bot Built Just for Fun: t.me/EthanWoof_Bot
3. Agenda
Steps to create an AI Conversational Agent (Virtual Agent | ChatBot)
• Getting started - Creating a Google Dialogflow account
• Manifest a Virtual Agent - Start creating a Dialogflow Agent (ChatBot/Agent)
• Create and Test a new Intent
• Make the Bot available on Telegram
14. Creating a Dialogflow Agent
Turning on a Virtual Agent
• Try saying “Hello!” … and see the Bot respond.
15. Create and Test a New Intent
Educating the Bot to understand Intents
16. Create and Test a New Intent
Educating the Bot to understand Intents
• Click on the “Create Intent” button
17. Create and Test a New Intent
Educating the Bot to understand Intents
Page to create a
new Intent
18. Create and Test a New Intent
Educating the Bot to understand Intents
• Give the Intent a descriptor, e.g. “get.bot.name”
• Click on “Add Training Phrases”
19. Create and Test a New Intent
Educating the Bot to understand Intents
• Enter the different ways that users will ask to get the bot’s name.
These are known as “Training Phrases”. Click “Save” when done.
Phrases used to “train” the Bot to
identify the Intent of the user when she
asks questions similar to these “Training
Phrases”. The more training phrases/
variations, the better the Bot learns to
identify this Intent.
Google’s advice is: “in most cases, you
should enter at least 10-20 (depending
on complexity of intent) training phrases
for reliable intent matching.”
20. Create and Test a New Intent
Educating the Bot to understand Intents
• Clicking “Save” will initiate the saving of the Intent. And start the Agent (Bot) to
train to understand to pick out this Intent from what the User says from now on
This appears when the Agent
training (to identify this Intent
from the supplied Training
Phrases is completed.
21. Create and Test a New Intent
Educating the Bot to understand Intents
• Now, teach the Bot how to respond if she identified that the User’s Intent is to
get the Bot’s name. Enter the acceptable responses in the “Text Response”
section of the “Add Intent” page. Click “Save” when done.
22. Here’s the Bot’s
response to the
question.
Create and Test a New Intent
Educating the Bot to understand Intents
Start testing the Bot to
see if she understands
that your intent is to get
the Bot’s name.
Type or click the icon
to “speak” the question
here.
Here’s the Intent
that the Bot
identified.
23. Congratulations!
Your very first Hello World! Bot is now “Live” on Telegram!
Have fun … Do continue to build awesome Bots!
Go to the following Website to learn more about creating Bot on Dialogflow:
https://cloud.google.com/dialogflow/docs/quick/build-agent
24. Make the Bot Available on
Telegram
Integrate to Telegram
25. Make the Bot available on Telegram
Integrate to Telegram
• Launch the Telegram app
• Chat with BotFather. Search for BotFather via the Telegram App or open this
link in Telegram: https://telegram.me/BotFather
• Give BotFather the start command by typing /start
• The issue the command /newbot and follow BotFather’s instructions
• Once successfully done, BotFather will issue a token
26. Make the Bot available on Telegram
Integrate to Telegram
Get this Telegram
Token from
BotFather
27. Make the Bot available on Telegram
Integrate to Telegram
• After obtaining the Telegram Token from
BotFather, head over to the Dialogflow console
and select “Integrations” to reach the
integrations selection page
• Click on the Telegram logo and the Telegram
integration pop-up window will appear
28. Make the Bot available on Telegram
Integrate to Telegram
• Toggle the switch on in the Telegram integration pop-up window. Then copy
the Telegram Token that was issued by BotFather and paste it in the Telegram
Token input box
29. Make the Bot available on Telegram
Integrate to Telegram
• Click the “Start” button. And this message should pop up on the bottom right
hand corner of your Dialogflow console:
• Close the pop-up window
30. Make the Bot available on Telegram
Integrate to Telegram
• On the Dialogflow console’s Integrations page, the switch in the Telegram
channel box should have toggled on after the Telegram integration pop-up
window is closed
31. Make the Bot available on Telegram
Integrate to Telegram
• Now, head over to the Telegram app
• Search for and add the Bot
• Start chatting with the Hello World! Bot
• Ask your friends to try as well …
32. Conversational AI Agent (ChatBot)
Key components
Conversational AI Agent (ChatBot)
NLU
(Understand + Respond)
Actions
(Do Something)
Machine Learning
Functions
<code>
External APIs
Databases
Channel
APIs
Invoke/Response
Intents + Entities in
Result of Actions out
Users
DeveloperConversational
Designer
Conversational AI Agent Manager
“Live”
Training
33. Ng Chong Yang
B.Eng (Hons, 1st), DipELN, Dip.M (CIM), MIEEE, FCIM
Email: bot@ethanwoof.com
Ethan Woof - A Telegram Bot Built Just for Fun: t.me/EthanWoof_Bot
Thank You!
Let’s Learn About ChatBots Together …