Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Chatbots and Conversational UI Development

You're reading from   Hands-On Chatbots and Conversational UI Development Build chatbots and voice user interfaces with Chatfuel, Dialogflow, Microsoft Bot Framework, Twilio, and Alexa Skills

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781788294669
Length 392 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Srini Janarthanam Srini Janarthanam
Author Profile Icon Srini Janarthanam
Srini Janarthanam
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introduction FREE CHAPTER 2. Tour Guide for Your City 3. Let's Talk Weather 4. Building a Persona Bot 5. Let's Catch a Train 6. Restaurant Search 7. The News Bot 8. My TV Guide 9. My Man Friday 10. More Resources

Building a two-way chatbot

So far, we have built a bot that can send SMS notifications to users at set time intervals. Although proactive, it is only communicating one way. The user is not able to send any request to the bot to change the nature or content of the message it is sending. Let's work on that.

To build a chatbot that can communicate both ways we need to do two things: build the chatbot into the web app and modify setup configurations in Twilio. To do these, follow these steps:

  1. Create an index.js file in the root directory of the project.
  2. Install the express and body-parser libraries. These libraries will be used to make a web app:
npm install body-parser --save
npm install express --save
  1. Create a web app in index.js:
// Two-way SMS Bot

const express = require('express')
const bodyParser = require('body-parser')
const twilio = require(...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime