SlideShare ist ein Scribd-Unternehmen logo
1 von 16
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

Weitere ähnliche Inhalte

Was ist angesagt?

Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...
Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...
Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...
Kishor Datta Gupta
 

Was ist angesagt? (12)

How To Set Up a Scalable Client Intake System
How To Set Up a Scalable Client Intake SystemHow To Set Up a Scalable Client Intake System
How To Set Up a Scalable Client Intake System
 
CNIT 129S: Ch 4: Mapping the Application
CNIT 129S: Ch 4: Mapping the ApplicationCNIT 129S: Ch 4: Mapping the Application
CNIT 129S: Ch 4: Mapping the Application
 
Recommending What Video to Watch Next: A Multitask Ranking System
Recommending What Video to Watch Next: A Multitask Ranking SystemRecommending What Video to Watch Next: A Multitask Ranking System
Recommending What Video to Watch Next: A Multitask Ranking System
 
Presentation- Chat GPT.pptx
Presentation- Chat GPT.pptxPresentation- Chat GPT.pptx
Presentation- Chat GPT.pptx
 
chatGPT.pptx
chatGPT.pptxchatGPT.pptx
chatGPT.pptx
 
Introducing marketo-performance-insights
Introducing marketo-performance-insightsIntroducing marketo-performance-insights
Introducing marketo-performance-insights
 
SEO and content marketing with AI Tools - Dale Bertrand, Fire&Spark
SEO and content marketing with AI Tools - Dale Bertrand, Fire&SparkSEO and content marketing with AI Tools - Dale Bertrand, Fire&Spark
SEO and content marketing with AI Tools - Dale Bertrand, Fire&Spark
 
Audit Technique SEO : les principales étapes à mettre en place
Audit Technique SEO : les principales étapes à mettre en placeAudit Technique SEO : les principales étapes à mettre en place
Audit Technique SEO : les principales étapes à mettre en place
 
Partial Homomorphic Encryption
Partial Homomorphic EncryptionPartial Homomorphic Encryption
Partial Homomorphic Encryption
 
Data Enrichment for Better Lead Generation
Data Enrichment for Better Lead GenerationData Enrichment for Better Lead Generation
Data Enrichment for Better Lead Generation
 
Unleashing the Power of OpenAI GPT-3 in FME Data Integration Workflows
Unleashing the Power of OpenAI GPT-3 in FME Data Integration WorkflowsUnleashing the Power of OpenAI GPT-3 in FME Data Integration Workflows
Unleashing the Power of OpenAI GPT-3 in FME Data Integration Workflows
 
Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...
Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...
Deep Reinforcement Learning based Recommendation with Explicit User-ItemInter...
 

Ähnlich wie First month with golang - Building Telegram chat bot

From Chatbots to Augmented Conversational Assistants
From Chatbots to Augmented Conversational AssistantsFrom Chatbots to Augmented Conversational Assistants
From Chatbots to Augmented Conversational Assistants
Databricks
 
Introduction for ChatGPT - Primer to Dummies
Introduction for ChatGPT - Primer to DummiesIntroduction for ChatGPT - Primer to Dummies
Introduction for ChatGPT - Primer to Dummies
SwethaKJ2
 

Ähnlich wie First month with golang - Building Telegram chat bot (20)

Deep dive into advanced teams development
Deep dive into advanced teams developmentDeep dive into advanced teams development
Deep dive into advanced teams development
 
Création facile de chatbots - Créez votre chatbot en 20 minutes avec une plat...
Création facile de chatbots - Créez votre chatbot en 20 minutes avec une plat...Création facile de chatbots - Créez votre chatbot en 20 minutes avec une plat...
Création facile de chatbots - Créez votre chatbot en 20 minutes avec une plat...
 
#OSSPARIS19 - Création facile de chatbots - Créez votre chatbot en 20 minutes...
#OSSPARIS19 - Création facile de chatbots - Créez votre chatbot en 20 minutes...#OSSPARIS19 - Création facile de chatbots - Créez votre chatbot en 20 minutes...
#OSSPARIS19 - Création facile de chatbots - Créez votre chatbot en 20 minutes...
 
From Chatbots to Augmented Conversational Assistants
From Chatbots to Augmented Conversational AssistantsFrom Chatbots to Augmented Conversational Assistants
From Chatbots to Augmented Conversational Assistants
 
SEO Exellence with ChatGPT-Webinar Duda
SEO Exellence with ChatGPT-Webinar DudaSEO Exellence with ChatGPT-Webinar Duda
SEO Exellence with ChatGPT-Webinar Duda
 
virtual-2021-data.sql_.saturday.la-Building database interactions with users ...
virtual-2021-data.sql_.saturday.la-Building database interactions with users ...virtual-2021-data.sql_.saturday.la-Building database interactions with users ...
virtual-2021-data.sql_.saturday.la-Building database interactions with users ...
 
Postman 101 for Developers
Postman 101 for Developers Postman 101 for Developers
Postman 101 for Developers
 
Create a Bot with Delphi and Telegram - ITDevCon 2016
Create a Bot with Delphi and Telegram - ITDevCon 2016Create a Bot with Delphi and Telegram - ITDevCon 2016
Create a Bot with Delphi and Telegram - ITDevCon 2016
 
PPt on Chat GPT New users.pptx
PPt on Chat GPT New users.pptxPPt on Chat GPT New users.pptx
PPt on Chat GPT New users.pptx
 
My slides from SharePoint Saturday Warsaw 2019
My slides from SharePoint Saturday Warsaw 2019My slides from SharePoint Saturday Warsaw 2019
My slides from SharePoint Saturday Warsaw 2019
 
Lessons learned from building a commercial bot development platform
Lessons learned from building a commercial bot development platformLessons learned from building a commercial bot development platform
Lessons learned from building a commercial bot development platform
 
Diwug 2019 Teams Development
Diwug 2019 Teams DevelopmentDiwug 2019 Teams Development
Diwug 2019 Teams Development
 
Clever data building a chatbot from your database
Clever data building a chatbot from your databaseClever data building a chatbot from your database
Clever data building a chatbot from your database
 
Server side tempalate injection
Server side tempalate injectionServer side tempalate injection
Server side tempalate injection
 
Mat Velloso - Bots in the real world
Mat Velloso - Bots in the real worldMat Velloso - Bots in the real world
Mat Velloso - Bots in the real world
 
Machine Learning 101 | Essential Tools for Machine Learning
Machine Learning 101 | Essential Tools for Machine LearningMachine Learning 101 | Essential Tools for Machine Learning
Machine Learning 101 | Essential Tools for Machine Learning
 
Introduction for ChatGPT - Primer to Dummies
Introduction for ChatGPT - Primer to DummiesIntroduction for ChatGPT - Primer to Dummies
Introduction for ChatGPT - Primer to Dummies
 
An Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python DeveloperAn Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python Developer
 
Chatbot Tutorial - Create your first bot with Xatkit
Chatbot Tutorial - Create your first bot with Xatkit Chatbot Tutorial - Create your first bot with Xatkit
Chatbot Tutorial - Create your first bot with Xatkit
 
ChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano FirtmanChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano Firtman
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 

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