chatbots in php - highsolutions phpce - matysiak - chatbots.pdf · where we can use it? •...
TRANSCRIPT
How to create chatbots
in PHP (and why)?
Link to this presentation
https://joind.in/talk/968d2
What is chatbot?
Definition:
“A conversational
user interface
used for interaction
with application”
Where we can use it?
• Automatic/interactive deployments
• DevOps
• Sales support (E-commerce)
• Customer service support
• Brand marketing
• Blog/content promotion
• Self-service (e.g. weather forecast, bus timetable etc.)
• Fun
• … ?
The time is now?
“Chatbot Market Size Is About To
Reach $1.25 Billion By 2025” GrandViewResearch, August 2017
Data source: https://neilpatel.com/blog/open-rates-facebook-messenger
How chatbot works?
1. Listening 🙉
2. Processing 🌀
3. Responding 📢
Mixed
Conversational Wizard-like
Types of chatbots
Broadcasting
Marcel Pociot
Managing Partner @beyondcode
@marcelpociot
Installation
Laravel:
composer global require "botman/installer"
botman new <directory>
php artisan serve
Vanilla PHP:
composer require "botman/botman"
Requirements
PHP >= 7.1.3
Available services
Amazon Alexa
Cisco Spark
Messenger
HipChat
Kik
Microsoft Bot
Framework
Nexmo
Slack
Telegram
Twilio
routes/botman.php
Controllers
Parameters
Regular expressions
Attachments
Responding
Response with an image
Questions
Predefined options
Starting conversations
Simple conversation
Questions with patterns
User information
Cache
NLP / NLU
NLP
Hey, I am going to PHPCE conference in Prague on Saturday at 10:00 with Grzegorz.
{"intent": "create_meeting","entities": {
"name": "PHPCE conference in Prague","invitees": ["Grzegorz"],"time": "2018-10-27 10:00:00"
}}
NLP
Middlewares
Testing
Testing
Web driver
Web widget
Button Template
Button Template
Generic Template
Generic Template
List Template
List Template
Media Template
Media Template
Quick replies
Quick replies
Quick replies
Quick replies
Quick replies
Menu
https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/persistent-menu
User information
• Facebook Identifier
• First name and Last name
• Avatar
• Gender
• Interface language
• Timezone
• …
Messenger Demo Viewer
Connecting bot with Messenger
1. Create a Facebook page
2. Create a Facebook app
3. Get your page token
1. Add new product > Messenger
2. Select your new Facebook Page
3. Copy token and paste into configuration
4. Setup webhook for Messenger
1. Provide URL to your BotMan instance (/botman)
2. Provide verification token
5. Activate your bot on the Page
BotMan Playground
BotMan Playgroundhttps://playground.botman.io/user/zjezak/test#botman.php
Where to get knowledge from?
• https://botman.io/ - Documentation / Demo
• https://botman.github.com - GitHub
• https://slack.botman.io/ - Slack for BotMan programmers
• https://buildachatbot.io/ - Video course
• https://playground.botman.io/ - On-line IDE
• https://christoph-rumpel.com/build-chatbots-with-php - E-book
• https://leanpub.com/chatbot – E-book
• https://www.youtube.com/watch?v=rz1lN-fKHHw - Marcel Pociot’s speech at PHP UK Conference 2018
Questions?
Link to this presentation
https://joind.in/talk/968d2