SlideShare a Scribd company logo
My first month with Golang
Building a Chat bot on
Telegram
How to start
• Get an idea
• Get API key from BotFather
• Run a service from your computer or server in any
language
• Programming Logic
Programming logic
• If then…else if …. else if…end
• - /start
• - /help
My bot
• - Dictionary bots: @envndictbot @thesaurusdictbot
• - Logic:
• If /start : welcome message
• If /help: help message
• If any word: check database to get definition
• If word from group chat: filter bot name
Flow chart(1)
Telegram Server Your computer
Polling
Messages request
limit<=100
Users
Message
Polling:
/getUpdates?offset=*&limit=*
Implementation
Flow chart(2)
Telegram Server Your computer
Users
Response
Text:*
ForceReply: *
KeyboardMarkup:*
Response
Response
Implementation
Number of ratings
Days Reviews
1 3
2 12
3 35
4 53
5 85
Storebot
Analytics
• Using redis: to count number of user, words
• Logging and email notification
Analytics
1 hi 150
2 hello 105
3 fuck 98
4 sex 72
5 good 63
6 book 59
7 love 58
8 start 55
9 go 30
10 ok 27
11 thesaurus 27
12 stop 21
13 apple 19
14 help 19
15 car 18
Avoid spam
• Using regular expression to validate bot input and
reduce work load
• Skip group message which not related to your bot
• Blacklist spammers
Design logo
Libraries
• https://storebot.me/
• Bot API https://core.telegram.org/bots/api
• My bot: https://github.com/aladine/envndictbot
• Libraries:
• github.com/rockneurotiko/go-tgbot
• https://github.com/tucnak/telebot
What I learnt
• Restful API
• Using log and email notification
• Build analytics using redis
• Write a go package
• User experience

More Related Content

Similar to First month with golang - Building Telegram chat bot (20)

PDF
From Chatbots to Augmented Conversational Assistants
Databricks
 
PPTX
Supercharge_AI_Presentation-fornbrgginrt .pptx
vinodchromium
 
PDF
SEO Exellence with ChatGPT-Webinar Duda
Anton Shulke
 
PPTX
virtual-2021-data.sql_.saturday.la-Building database interactions with users ...
Luis Beltran
 
PPTX
Postman 101 for Developers
Postman
 
PPTX
PPt on Chat GPT New users.pptx
MohdMansoorAli1
 
PPTX
My slides from SharePoint Saturday Warsaw 2019
Rick Van Rousselt
 
PDF
Lessons learned from building a commercial bot development platform
Jordi Cabot
 
PPTX
Diwug 2019 Teams Development
Albert-Jan Schot
 
PPTX
Clever data building a chatbot from your database
Luis Beltran
 
PPTX
Server side tempalate injection
Narendra Kumar
 
PPTX
Mat Velloso - Bots in the real world
Web à Québec
 
PPTX
Machine Learning 101 | Essential Tools for Machine Learning
Hafiz Muhammad Attaullah
 
PPTX
Introduction for ChatGPT - Primer to Dummies
SwethaKJ2
 
PPTX
chatGPT.pptx
MahiJamunkar
 
PPTX
Python for IoT CoE.pptx KDOJWIHJNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
SalihaBathool
 
PDF
An Ultimate Guide To Hire Python Developer
RishiVardhaniM
 
PPTX
Chatbot Tutorial - Create your first bot with Xatkit
Jordi Cabot
 
PPTX
ChatGpt power point presentation submitted.
dishwanksnoopyjullyg
 
PDF
ChatGPT and AI for web developers - Maximiliano Firtman
Wey Wey Web
 
From Chatbots to Augmented Conversational Assistants
Databricks
 
Supercharge_AI_Presentation-fornbrgginrt .pptx
vinodchromium
 
SEO Exellence with ChatGPT-Webinar Duda
Anton Shulke
 
virtual-2021-data.sql_.saturday.la-Building database interactions with users ...
Luis Beltran
 
Postman 101 for Developers
Postman
 
PPt on Chat GPT New users.pptx
MohdMansoorAli1
 
My slides from SharePoint Saturday Warsaw 2019
Rick Van Rousselt
 
Lessons learned from building a commercial bot development platform
Jordi Cabot
 
Diwug 2019 Teams Development
Albert-Jan Schot
 
Clever data building a chatbot from your database
Luis Beltran
 
Server side tempalate injection
Narendra Kumar
 
Mat Velloso - Bots in the real world
Web à Québec
 
Machine Learning 101 | Essential Tools for Machine Learning
Hafiz Muhammad Attaullah
 
Introduction for ChatGPT - Primer to Dummies
SwethaKJ2
 
chatGPT.pptx
MahiJamunkar
 
Python for IoT CoE.pptx KDOJWIHJNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
SalihaBathool
 
An Ultimate Guide To Hire Python Developer
RishiVardhaniM
 
Chatbot Tutorial - Create your first bot with Xatkit
Jordi Cabot
 
ChatGpt power point presentation submitted.
dishwanksnoopyjullyg
 
ChatGPT and AI for web developers - Maximiliano Firtman
Wey Wey Web
 

Recently uploaded (20)

PDF
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
PPTX
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
PPTX
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
 
PDF
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
PPTX
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
PDF
Telemedicine App Development_ Key Factors to Consider for Your Healthcare Ven...
Mobilityinfotech
 
PPTX
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
 
PDF
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
 
PDF
Rewards and Recognition (2).pdf
ethan Talor
 
PPTX
B2C EXTRANET | EXTRANET WEBSITE | EXTRANET INTEGRATION
philipnathen82
 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
PPTX
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
 
PDF
>Wondershare Filmora Crack Free Download 2025
utfefguu
 
PPTX
ERP - FICO Presentation BY BSL BOKARO STEEL LIMITED.pptx
ravisranjan
 
PDF
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
PPTX
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
 
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
Telemedicine App Development_ Key Factors to Consider for Your Healthcare Ven...
Mobilityinfotech
 
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
 
Designing Accessible Content Blocks (1).pdf
jaclynmennie1
 
Rewards and Recognition (2).pdf
ethan Talor
 
B2C EXTRANET | EXTRANET WEBSITE | EXTRANET INTEGRATION
philipnathen82
 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
IObit Driver Booster Pro Crack Download Latest Version
chaudhryakashoo065
 
>Wondershare Filmora Crack Free Download 2025
utfefguu
 
ERP - FICO Presentation BY BSL BOKARO STEEL LIMITED.pptx
ravisranjan
 
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
ManageIQ - Sprint 264 Review - Slide Deck
ManageIQ
 
Ad

First month with golang - Building Telegram chat bot

  • 1. My first month with Golang Building a Chat bot on Telegram
  • 2. How to start • Get an idea • Get API key from BotFather • Run a service from your computer or server in any language • Programming Logic
  • 3. Programming logic • If then…else if …. else if…end • - /start • - /help
  • 4. My bot • - Dictionary bots: @envndictbot @thesaurusdictbot • - Logic: • If /start : welcome message • If /help: help message • If any word: check database to get definition • If word from group chat: filter bot name
  • 5. Flow chart(1) Telegram Server Your computer Polling Messages request limit<=100 Users Message Polling: /getUpdates?offset=*&limit=*
  • 7. Flow chart(2) Telegram Server Your computer Users Response Text:* ForceReply: * KeyboardMarkup:* Response Response
  • 9. Number of ratings Days Reviews 1 3 2 12 3 35 4 53 5 85
  • 11. Analytics • Using redis: to count number of user, words • Logging and email notification
  • 12. Analytics 1 hi 150 2 hello 105 3 fuck 98 4 sex 72 5 good 63 6 book 59 7 love 58 8 start 55 9 go 30 10 ok 27 11 thesaurus 27 12 stop 21 13 apple 19 14 help 19 15 car 18
  • 13. Avoid spam • Using regular expression to validate bot input and reduce work load • Skip group message which not related to your bot • Blacklist spammers
  • 15. Libraries • https://storebot.me/ • Bot API https://core.telegram.org/bots/api • My bot: https://github.com/aladine/envndictbot • Libraries: • github.com/rockneurotiko/go-tgbot • https://github.com/tucnak/telebot
  • 16. What I learnt • Restful API • Using log and email notification • Build analytics using redis • Write a go package • User experience