SlideShare a Scribd company logo
1 of 29
Download to read offline
Create Your Bot with Delphi
Crea il tuo Bot con Delphi
Who am I?
About me
Marco Breveglieri
Software and Web Developer
www.compilaquindiva.com
Via De Gasperi 14
42019 Scandiano (RE)
ITALY
You might find interesting…
Delphi Succinctly
Learn the fundamentals of Delphi
to build a variety of solutions for
many devices and platforms in
about 100 pages.
Find more here:
👉 http://bit.ly/delphi-succinctly
You might find interesting…
Delphi Podcast
The first Italian podcast
about Delphi.
Listen here:
👉 http://www.delphipodcast.com
and also take part in it!
You might find interesting…
Component Tales
Find out what Delphi components
do when you close the IDE...
Smile (if you can) here:
👉 https://twitter.com/ComponentTales
Bots!
An introduction to Bots
What is a Bot?
A «(Ro)bot» is a software
application that runs
automated tasks over the
Internet.
Typically, bots perform tasks
that are both simple and
structurally repetitive, at a
much higher rate than
would be possible for a
human alone.
Bot Purposes
• Communicate with other users (that's our case 👍)
• Instant Messaging and IRC
• Social Bots
• Telegram Bots
• Commercial Purposes
• Auctions and Bets (eBay, Betfair, …)
• Application and Content Stores (Apple Store, Google Play, YouTube …)
• Malicious Purposes
• Spam bots
• DDos attacker
• Gaming
• MMORPG
What you can do
• Get customized notification and
news
• Integrate your messaging
experience with external
services
• Create your own custom service
• Create games (NEW! in Telegram
Bots)
• Smart newspapers
• Weather forecast
• Local news or events
• Track shipping
• Translate content on-the-fly
• Import photos, videos and
content
• Build a knowledge base
• Get cool! 😎
What you can do
Why Chat Bots?
• Bots are a lot easier to install than mobile apps
• Bots are easily distributed
• Quality mobile apps are expensive to build, mantain and deploy
• You don't have to deal with security aspects
• Moving complexity to the cloud reduces a user's cognitive load
Natural Language Processing
NLP is the ability of a
computer program to
understand human speech
as it is written or spoken.
• It makes computer to perform
useful tasks with the natural
languages humans use
• It is based on machine learning
• Supports both speech and text
But we will not deal with NLP in
this speech.
Platforms and Frameworks
Just to name a few…
• Microsoft Bot Framework
• Telegram API/SDK
• Facebook Messenger Bots
• Google Allo (?)
Telegram
Get to know Telegram
What is Telegram?
Telegram is a cloud-based instant
messaging (IM) service.
Users can send and exchange
• Simple messages
• Photos and videos
• Stickers
• Virtually any type of file
• Supports (custom) encrypted
(E2E) messaging
• Cloud Based Architecture
• Native app for every platform,
including Web
• Client-side code is open-source
• Server-side code is proprietary
and closed-source
Available Clients
Telegram supports a wide
range of devices and
operating systems.
• Web
• Windows
• Android
• iOS
• Windows Phone
• OSX
• Linux
• Ubuntu Touch
Telegram Facts
• 100 million Monthly Active Users
• 350 K of signups per day
• 15 billion daily message sent
• Has proven to be quite robust
• Has a good Bot platform!
Telegram Bot Platform
• Release in June 2015:
recent but powerful!
• Updated just some day ago
(added Game support)
• Open to everyone without
barriers
• No approval process required
• Allows 1-1 conversations
• Can be added to groups
and channels
• Can be invoked "on the fly"
(inline bots)
Difference with humans
• No online status and no last seen timestamps
• Can't initiate conversation with users
• Username always ends in "bot"
• When added to a group, bots do not receive all messages by default
• Bots never eat, sleep or complain (unless expressly programmed
otherwise)
Let's see some sample
Comune di Reggio Emilia BOT (@ComuneREbot)
https://telegram.me/ComuneREbot
Nice Bots:
• TrackBot (https://botfactory.info/trackbot/)
• Giphy Bot (https://telegram.me/gif)
• TerremotiBot (https://botfactory.info/terremotibot/)
• CinemasBot (https://telegram.me/cinemasbot)
Want more?
http://botsfortelegram.com/
Create a Bot
Let's create a Bot with Telegram
How do bots work?
• Send messages and commands to
bots by opening a chat with them
or by adding them to groups.
• Send requests directly from the
input field by typing the bot's
@username and a query (inline
bots)
• Messages, commands and requests
sent by users are passed to the
software running on Telegram
servers.
• Telegram servers handles all
encryption and communication
with the Telegram API for you.
• You communicate with this server
via a simple HTTPS-interface that
offers a simplified version of the
Telegram API: the Bot API.
Create a new Bot
BotFather is the one bot to rule
them all.
It will help you create new bots
and change settings for existing
ones.
«One Bot to rule them all, One Bot to
find them
One Bot to bring them all and in the
darkness bind them»
-- The Lord of the Bots, J.R.R.Tolkien
Bot API
• The Bot API is an HTTP-based api
• It supports GET and POST requests
Making Requests
• All queries must be served over HTTPS and in this form:
https://api.telegram.org/bot<token>/METHOD_NAME
• All queries must be made using UTF-8
• All methods are case-insensitive
• The response is a JSON object which:
• always has an 'ok' boolean field.
• has a 'result' field if the response is ok.
• may have an optional 'description' field which contains some info about the occurred error
• also has a 'error_code' in the case of errors.
Let's test it!
How to get updates?
Call the method name:
getUpdates()
You can use
• Continuous Polling
• Long Polling technique
(easy, but slightly inefficient and
resource consumer)
• Webhooks
(better, but more complex)
Let's see some code
Questions?
Don't be afraid
of asking…
Thanks!
😇

More Related Content

Similar to Create a Bot with Delphi and Telegram - ITDevCon 2016

Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachITCamp
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp
 
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 platformJordi Cabot
 
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...Sébastien Levert
 
Global Azure2021 Verona.pptx
Global Azure2021 Verona.pptxGlobal Azure2021 Verona.pptx
Global Azure2021 Verona.pptxLuis Beltran
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intentAbhishek Sur
 
The Software Challenges of Building Smart Chatbots - ICSE'21
The Software Challenges of Building Smart Chatbots - ICSE'21The Software Challenges of Building Smart Chatbots - ICSE'21
The Software Challenges of Building Smart Chatbots - ICSE'21Jordi Cabot
 
Introduction to BOT Framework- Global Azure Bootcamp 2017
Introduction to BOT Framework- Global Azure Bootcamp 2017Introduction to BOT Framework- Global Azure Bootcamp 2017
Introduction to BOT Framework- Global Azure Bootcamp 2017Jalpesh Vadgama
 
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot Design
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot DesignChatbot Revolution: Exploring Opportunities, Use Cases, & Bot Design
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot DesignStefan Kojouharov
 
Ai chatbot ppt.pptx
Ai chatbot ppt.pptxAi chatbot ppt.pptx
Ai chatbot ppt.pptxaashnareddy1
 
OroCRM CTO Yoav Kutner Presents at Meet Magento
OroCRM CTO Yoav Kutner Presents at Meet MagentoOroCRM CTO Yoav Kutner Presents at Meet Magento
OroCRM CTO Yoav Kutner Presents at Meet MagentoJary Carter
 
Build an Intelligent Bot
Build an Intelligent BotBuild an Intelligent Bot
Build an Intelligent BotSorin Peste
 
rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...
rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...
rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...Dariia Seimova
 
Conversational UI Bot Framework
Conversational UI Bot FrameworkConversational UI Bot Framework
Conversational UI Bot Frameworkvivek p s
 
New Botnets Trends and Threats (BH Europe 2007)
New Botnets Trends and Threats (BH Europe 2007)New Botnets Trends and Threats (BH Europe 2007)
New Botnets Trends and Threats (BH Europe 2007)André Fucs de Miranda
 

Similar to Create a Bot with Delphi and Telegram - ITDevCon 2016 (20)

Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent Ellerbach
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
 
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
 
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
 
Chatbot ppt
Chatbot pptChatbot ppt
Chatbot ppt
 
Global Azure2021 Verona.pptx
Global Azure2021 Verona.pptxGlobal Azure2021 Verona.pptx
Global Azure2021 Verona.pptx
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intent
 
The Software Challenges of Building Smart Chatbots - ICSE'21
The Software Challenges of Building Smart Chatbots - ICSE'21The Software Challenges of Building Smart Chatbots - ICSE'21
The Software Challenges of Building Smart Chatbots - ICSE'21
 
Introduction to BOT Framework- Global Azure Bootcamp 2017
Introduction to BOT Framework- Global Azure Bootcamp 2017Introduction to BOT Framework- Global Azure Bootcamp 2017
Introduction to BOT Framework- Global Azure Bootcamp 2017
 
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot Design
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot DesignChatbot Revolution: Exploring Opportunities, Use Cases, & Bot Design
Chatbot Revolution: Exploring Opportunities, Use Cases, & Bot Design
 
Etherium Intro for techies
Etherium Intro for techiesEtherium Intro for techies
Etherium Intro for techies
 
PyMultitor
PyMultitorPyMultitor
PyMultitor
 
Dialogflow
DialogflowDialogflow
Dialogflow
 
Everything you need to know about chatbots
Everything you need to know about chatbotsEverything you need to know about chatbots
Everything you need to know about chatbots
 
Ai chatbot ppt.pptx
Ai chatbot ppt.pptxAi chatbot ppt.pptx
Ai chatbot ppt.pptx
 
OroCRM CTO Yoav Kutner Presents at Meet Magento
OroCRM CTO Yoav Kutner Presents at Meet MagentoOroCRM CTO Yoav Kutner Presents at Meet Magento
OroCRM CTO Yoav Kutner Presents at Meet Magento
 
Build an Intelligent Bot
Build an Intelligent BotBuild an Intelligent Bot
Build an Intelligent Bot
 
rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...
rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...
rohit sharma - dev ops virtual assistant - automate devops stuffs using nlp a...
 
Conversational UI Bot Framework
Conversational UI Bot FrameworkConversational UI Bot Framework
Conversational UI Bot Framework
 
New Botnets Trends and Threats (BH Europe 2007)
New Botnets Trends and Threats (BH Europe 2007)New Botnets Trends and Threats (BH Europe 2007)
New Botnets Trends and Threats (BH Europe 2007)
 

More from Marco Breveglieri

Delphi & Dintorni Webinar - Diventa un mago del Testing
Delphi & Dintorni Webinar - Diventa un mago del TestingDelphi & Dintorni Webinar - Diventa un mago del Testing
Delphi & Dintorni Webinar - Diventa un mago del TestingMarco Breveglieri
 
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con DelphiDelphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con DelphiMarco Breveglieri
 
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...Marco Breveglieri
 
Creare un Information Radiator con Delphi
Creare un Information Radiator con DelphiCreare un Information Radiator con Delphi
Creare un Information Radiator con DelphiMarco Breveglieri
 
"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in Delphi
"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in Delphi"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in Delphi
"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in DelphiMarco Breveglieri
 
REST API fantastiche e dove trovarle
REST API fantastiche e dove trovarleREST API fantastiche e dove trovarle
REST API fantastiche e dove trovarleMarco Breveglieri
 
Applicazioni Web ultra-performanti con Vue.js e Delphi
Applicazioni Web ultra-performanti con Vue.js e DelphiApplicazioni Web ultra-performanti con Vue.js e Delphi
Applicazioni Web ultra-performanti con Vue.js e DelphiMarco Breveglieri
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Marco Breveglieri
 
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, PiacenzaSviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, PiacenzaMarco Breveglieri
 
Reportage "RAD Studio XE2 World Tour"
Reportage "RAD Studio XE2 World Tour"Reportage "RAD Studio XE2 World Tour"
Reportage "RAD Studio XE2 World Tour"Marco Breveglieri
 

More from Marco Breveglieri (11)

Delphi & Dintorni Webinar - Diventa un mago del Testing
Delphi & Dintorni Webinar - Diventa un mago del TestingDelphi & Dintorni Webinar - Diventa un mago del Testing
Delphi & Dintorni Webinar - Diventa un mago del Testing
 
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con DelphiDelphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
Delphi & Dintorni Webinar - Padroneggiare i principi SOLID con Delphi
 
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
 
Creare un Information Radiator con Delphi
Creare un Information Radiator con DelphiCreare un Information Radiator con Delphi
Creare un Information Radiator con Delphi
 
"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in Delphi
"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in Delphi"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in Delphi
"Non Aprite Quella Unit!" ovvero "Scrivere Clean Code in Delphi
 
REST API fantastiche e dove trovarle
REST API fantastiche e dove trovarleREST API fantastiche e dove trovarle
REST API fantastiche e dove trovarle
 
Applicazioni Web ultra-performanti con Vue.js e Delphi
Applicazioni Web ultra-performanti con Vue.js e DelphiApplicazioni Web ultra-performanti con Vue.js e Delphi
Applicazioni Web ultra-performanti con Vue.js e Delphi
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, PiacenzaSviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
Sviluppo Web con React e Delphi - Seminario Delphi Day 2016, Piacenza
 
Reportage Delphi Day 2012
Reportage Delphi Day 2012Reportage Delphi Day 2012
Reportage Delphi Day 2012
 
Reportage "RAD Studio XE2 World Tour"
Reportage "RAD Studio XE2 World Tour"Reportage "RAD Studio XE2 World Tour"
Reportage "RAD Studio XE2 World Tour"
 

Recently uploaded

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 GoalsJhone kinadey
 
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 🔝✔️✔️Delhi Call girls
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
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 🔝✔️✔️Delhi Call girls
 
%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 tembisamasabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
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.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%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 kaalfonteinmasabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 

Recently uploaded (20)

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 🔝✔️✔️
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
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 🔝✔️✔️
 
%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
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%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
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

Create a Bot with Delphi and Telegram - ITDevCon 2016

  • 1. Create Your Bot with Delphi Crea il tuo Bot con Delphi
  • 3. About me Marco Breveglieri Software and Web Developer www.compilaquindiva.com Via De Gasperi 14 42019 Scandiano (RE) ITALY
  • 4. You might find interesting… Delphi Succinctly Learn the fundamentals of Delphi to build a variety of solutions for many devices and platforms in about 100 pages. Find more here: 👉 http://bit.ly/delphi-succinctly
  • 5. You might find interesting… Delphi Podcast The first Italian podcast about Delphi. Listen here: 👉 http://www.delphipodcast.com and also take part in it!
  • 6. You might find interesting… Component Tales Find out what Delphi components do when you close the IDE... Smile (if you can) here: 👉 https://twitter.com/ComponentTales
  • 8. What is a Bot? A «(Ro)bot» is a software application that runs automated tasks over the Internet. Typically, bots perform tasks that are both simple and structurally repetitive, at a much higher rate than would be possible for a human alone.
  • 9. Bot Purposes • Communicate with other users (that's our case 👍) • Instant Messaging and IRC • Social Bots • Telegram Bots • Commercial Purposes • Auctions and Bets (eBay, Betfair, …) • Application and Content Stores (Apple Store, Google Play, YouTube …) • Malicious Purposes • Spam bots • DDos attacker • Gaming • MMORPG
  • 10. What you can do • Get customized notification and news • Integrate your messaging experience with external services • Create your own custom service • Create games (NEW! in Telegram Bots) • Smart newspapers • Weather forecast • Local news or events • Track shipping • Translate content on-the-fly • Import photos, videos and content • Build a knowledge base • Get cool! 😎
  • 12. Why Chat Bots? • Bots are a lot easier to install than mobile apps • Bots are easily distributed • Quality mobile apps are expensive to build, mantain and deploy • You don't have to deal with security aspects • Moving complexity to the cloud reduces a user's cognitive load
  • 13. Natural Language Processing NLP is the ability of a computer program to understand human speech as it is written or spoken. • It makes computer to perform useful tasks with the natural languages humans use • It is based on machine learning • Supports both speech and text But we will not deal with NLP in this speech.
  • 14. Platforms and Frameworks Just to name a few… • Microsoft Bot Framework • Telegram API/SDK • Facebook Messenger Bots • Google Allo (?)
  • 16. What is Telegram? Telegram is a cloud-based instant messaging (IM) service. Users can send and exchange • Simple messages • Photos and videos • Stickers • Virtually any type of file • Supports (custom) encrypted (E2E) messaging • Cloud Based Architecture • Native app for every platform, including Web • Client-side code is open-source • Server-side code is proprietary and closed-source
  • 17. Available Clients Telegram supports a wide range of devices and operating systems. • Web • Windows • Android • iOS • Windows Phone • OSX • Linux • Ubuntu Touch
  • 18. Telegram Facts • 100 million Monthly Active Users • 350 K of signups per day • 15 billion daily message sent • Has proven to be quite robust • Has a good Bot platform!
  • 19. Telegram Bot Platform • Release in June 2015: recent but powerful! • Updated just some day ago (added Game support) • Open to everyone without barriers • No approval process required • Allows 1-1 conversations • Can be added to groups and channels • Can be invoked "on the fly" (inline bots)
  • 20. Difference with humans • No online status and no last seen timestamps • Can't initiate conversation with users • Username always ends in "bot" • When added to a group, bots do not receive all messages by default • Bots never eat, sleep or complain (unless expressly programmed otherwise)
  • 21. Let's see some sample Comune di Reggio Emilia BOT (@ComuneREbot) https://telegram.me/ComuneREbot Nice Bots: • TrackBot (https://botfactory.info/trackbot/) • Giphy Bot (https://telegram.me/gif) • TerremotiBot (https://botfactory.info/terremotibot/) • CinemasBot (https://telegram.me/cinemasbot) Want more? http://botsfortelegram.com/
  • 22. Create a Bot Let's create a Bot with Telegram
  • 23. How do bots work? • Send messages and commands to bots by opening a chat with them or by adding them to groups. • Send requests directly from the input field by typing the bot's @username and a query (inline bots) • Messages, commands and requests sent by users are passed to the software running on Telegram servers. • Telegram servers handles all encryption and communication with the Telegram API for you. • You communicate with this server via a simple HTTPS-interface that offers a simplified version of the Telegram API: the Bot API.
  • 24. Create a new Bot BotFather is the one bot to rule them all. It will help you create new bots and change settings for existing ones. «One Bot to rule them all, One Bot to find them One Bot to bring them all and in the darkness bind them» -- The Lord of the Bots, J.R.R.Tolkien
  • 25. Bot API • The Bot API is an HTTP-based api • It supports GET and POST requests Making Requests • All queries must be served over HTTPS and in this form: https://api.telegram.org/bot<token>/METHOD_NAME • All queries must be made using UTF-8 • All methods are case-insensitive • The response is a JSON object which: • always has an 'ok' boolean field. • has a 'result' field if the response is ok. • may have an optional 'description' field which contains some info about the occurred error • also has a 'error_code' in the case of errors. Let's test it!
  • 26. How to get updates? Call the method name: getUpdates() You can use • Continuous Polling • Long Polling technique (easy, but slightly inefficient and resource consumer) • Webhooks (better, but more complex)