33,59 €
Automate workflow and internal communication processes and provide customer service without apps using messaging and interactive bots
This is a book for Node.js developers who want to build powerful bots for customer-facing and internal workflow automation.
The bots are taking over and we're all for it! Messenger-based bots will be the dominant software UI for the next generation of applications – even Slack, Telegram, and Facebook are driving a new approach where "threads are the new apps."
This book shows you how to create work automation bots that interact with users through Slack, e-mail, Skype, Twitter, and more using Node.js. You'll learn to create conversational UIs for your Node.js apps, and then use those UIs to provide workflow automation tools.
You will be shown how to handle customer service requests that come in through messenger systems – this includes interpreting the natural language to reveal the user's intent and respond accordingly. You will also learn how to automate processes that involve several people, such as processing holiday requests, arranging meetings, or sending updated reports on time.
By the end of this book you'll have the knowledge to create bots that can handle and manipulate documents, URLs, and other items of content. Harness the power of bots and your organization will reap the benefits.
This fast-paced book is packed with real-world use cases that will help you understand concepts, issues, and solutions while using Node.js to build useful, cross-platform business bots.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 230
Veröffentlichungsjahr: 2017
Copyright © 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2017
Production reference: 1240117
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-545-0
www.packtpub.com
Authors
Eduardo Freitas
Madan Bhintade
Copy Editor
Safis Editing
Reviewers
Allen O'Neill
Project Coordinator
Sheejal Shah
Commissioning Editor
David Barnes
Proofreader
Safis Editing
Acquisition Editor
Shweta Pant
Indexer
Mariammal Chettiyar
Content Development Editor
Parshva Sheth
Graphics
Abhinash Sahu
Technical Editor
Prashant Mishra
Production Coordinator
Melwyn Dsa
Eduardo Freitas currently works as a consultant on software development applied to customer success, mostly related to financial process automation, accounts payable processing, invoice data extraction and SAP integration.
He has provided consultancy services, engineered, advised and supported various projects for global names such as Agfa, Coca Cola, Domestic & General, EY, Enel, Mango and the Social Security Agency among many others. He’s also been invited to various companies such as Shell, Capgemini, Cognizant and the European Space Agency. He was recently involved in analyzing 1.6 billion rows of data using Redshift (Amazon Web Services) in order to gather valuable insights on client patterns. He holds an M.S. in Computer Science.
He enjoys soccer, running, traveling, life hacking, learning and spending time with his family. You can reach him at http://edfreitas.me.
Many thanks to all the people who contributed to this book. All the lovely and amazing team at Packt and also to Madan Bhintade for believing in the project and helping me finalize it.
Madan Bhintade is an independent solution architect. He is also a developer with focus on cloud based solutions. He enjoys development on AWS, Microsoft Azure & Office 365, SharePoint Server, Angular, and Node.js. He has 16 years of experience building solutions for insurance, financial & banking, and HR industries.
Madan is passionate about what he does and shares what he has learnt through his blog. He also enjoys speaking on what he is exploring in technology area and helps others to adopt the changes in technology. His typical interest areas include UX, Digital Technology Platforms, and artificial intelligence.
He is a C# Corner MVP. His contribution towards C# Corner can be seen at http://www.c-sharpcorner.com/members/madan-bhintade. He can be connected with via LinkedIn https://in.linkedin.com/in/madanbhintade.
Currently he is working on his startup concept along with his consulting assignments. You can reach Madan on his blog http://www.madanbhintade.wordpress.com and follow him on Twitter at @madanbhintade.
Allen is a chartered engineer with a background in enterprise systems. He is a fellow of the British Computing Society, a Microsoft Insider, and both a CodeProject and C-Sharp Corner MVP. His core technology interests are big data and machine learning, in particular using data science to create intelligent bots/agents for the web, and the Internet of Things. He is also a ball throwing slave to his family dogs.
Allen writes regularly at: Code Project - https://www.codeproject.com/members/ajson and C-Sharp Corner - http://www.c-sharpcorner.com/members/allen-oneill.
He can be contacted at www.blox.io or on twitter @ajsondev
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.
Thank you for purchasing this Packt book. We take our commitment to improving our content and products to meet your needs seriously—that's why your feedback is so valuable. Whatever your feelings about your purchase, please consider leaving a review on this book's Amazon page. Not only will this help us, more importantly it will also help others in the community to make an informed decision about the resources that they invest in to learn. You can also review for us on a regular basis by joining our reviewers' club. If you're interested in joining, or would like to learn more about the benefits we offer, please contact us: [email protected].
Bots everywhere! Conversational and chat-enabled apps are well positioned to become the next big platform and how apps are developed. Advances in machine learning, natural conversational APIs have taken off and many high tech and software giants are embracing conversational bots and provide APIs that allow developers to create applications that seamlessly integrate into these conversational platforms, enhancing user’s experience. This book explores some of these platforms in and simple and intuitive way, allowing developers to quickly come up to speed with them.
Chapter 1, The Rise of Bots – Getting the Message Across, introduces and explains the growing importance of bots in today’s world and also teaches you how to create an SMS bot app using the Twilio messaging platform.
Chapter 2, Getting Skype to Work for You, explains how to use the new Microsoft Bot Framework in order to create a Skype bot.
Chapter 3, Twitter as a Flight Information Agent, teaches you how to create a Twitter bot application that interacts with the Air France KLM API in order to retrieve flight details.
Chapter 4, A Slack Quote Bot, explains how to create a Slack bot application that sends inspirational quotes to users.
Chapter 5, Telegram-Powered Bots, shows you how to develop a bot that will provide you the sentiments of messages on Telegram using Telegram APIs.
Chapter 6, BotKit – Document Manager Agent for Slack, teaches you how to use Slack APIs with BotKit to provide documents at the fingertips of team members collaborating in Slack.
Chapter 7, Facebook Messenger Bot, Who's Off – A Scheduler Bot for Teams, shows you how to set up a Facebook Messenger Bot that can be used to schedule team meetings, or to see who is off when with the help of the Microsoft Azure platform and services.
Chapter 8, A Bug-Tracking Agent for Teams, teaches you how to use the IRC platform and DocumentDB for a bug-tracking bot.
Chapter 9, A Kik Salesforce CRM Bot, explores how to use Force.com API and a Kik to create a Salesforce CRM Bot.
The following requirements are recommended for maximum enjoyment:
Pretty much all software and APIs mentioned in this book are free of charge and can be downloaded from the Internet.
This book is for anyone that knows some Node.js and would like to explore how a bot can be written with the various existing conversational platforms available today. The book is written in an easy-to-understand way that is suitable for developers of all kinds, from novice to very experienced ones. Some know-how of Node.js is recommended.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The session object contains the information that Skype passes on to the bot app, which describes the session data that has been received and from whom. Notice that the session object contains properties such as message and text."
A block of code is set as follows:
bot.dialog('/', function (session) { if (session.message.text.toLowerCase().indexOf('hi') >= 0){ session.send('Hi ' + session.message.user.name + ' thank you for your message: ' + session.message.text); } else{ session.send('Sorry I dont understand you...'); } });Any command-line input or output is written as follows:
mkdir telegrambotcd telegrambotNew terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on the Register a bot option in order to create and register your Skype bot. Once you've done that, you'll see the following screen:"
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Building-Bots-with-Nodejs. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from: https://www.packtpub.com/sites/default/files/downloads/BuildingBotswithNodejs_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.
Nowadays customers are demanding to communicate with brands, companies, and organizations as casually as they talk to their friends, and they expect an immediate response. Providing that level of service is quite impractical, if not rather logistically impossible to achieve for most organizations, without using some form of automation.
Until recently, the limitations of automated technology meant compromising the seamless, robust experience that's been proven to create loyal customers. Running a call center is an expensive undertaking and yet in order to be able to provide that instant communication channel with customers, most brands and companies opted to do this, in order to provide that instant response.
With the advent of Artificial Intelligence (AI), Natural Language Processing (NLP), Machine Learning (ML), and Sentiment Analysis APIs and frameworks, semi-automated or fully automated agents known as bots are radically changing everything we know about customer communication, initiating a revolution in the way customer interaction is done.
With fewer people using their phone to make phone calls anymore, but instead using their phones for anything else but talking, messaging has become the de facto way to communicate.
A great deal of smartphone owners use their devices to make calls, but most use them for text-based communication (texting/SMS, messaging, or chat). The average adult spends a total of 23 hours a week texting. Furthermore over a lifetime, the average Millennial will spend an astonishing 12 years texting.
The reason for the rise of text messaging as a communication platform is that phone calls are interruptive, inconvenient, and inefficient. They don't allow for multitasking-when you're using your smartphone to make a call, it cannot be used for anything else. While in the past we used to just pick up the phone to solve a problem, now we start with text-based messages, and then escalate to voice.
Another significantly important reason for messaging adoption is that customers are demanding interaction where they already are.
Messaging and chat-related apps are rapidly gaining popularity over SMS, especially among younger people. Globally, 6 of the 10 top apps are messaging applications such as Facebook Messenger, WhatsApp, Telegram, and WeChat.
The main reason for this increased usage of messaging apps is that these don't count against monthly SMS limits, and if you're connected to Wi-Fi, these don't use up any data either. Further to that, there's also an emotional component, which enhances the overall conversation. Messaging has the feel of a real-time conversation. You know when your friends are active in the app and even when they're typing a response, which makes it an addictive and highly engaging medium to communicate with.
With this scenario in perspective, creating messaging bots that provide meaningful interaction with customers provides a cutting-edge advantage to any business, by using today's most common communication medium and also being where customers already are, on their messaging apps.
In this book, we'll explore how we can write bots using various platforms, APIs, and SDKs in order to tackle some of today's most interesting business problems, in steps that are easy to follow and at the same time fun to implement. Specifically, this chapter will dig into:
Let's not wait any further and get into the details. Have fun!
In the broad sense of its definition, a bot is a piece of software that leverages artificial narrow intelligence to perform specific tasks in place of a human. Bots understand language to a certain extent and not just commands. Ultimately, they could learn from their interactions to get smarter and better.
In roughly two years time, 3.6 billion people (yes 3.6 billion) are projected to be using messaging apps--that's 90% of total Internet users, which is more people than could ever be served with a continuous thread of communication compared to more traditional platforms such as e-mail. Refer to the following link for more information: https://hbr.org/2016/09/messaging-apps-are-changing-how-companies-talk-with-customers .
Worldwide, consumers are now demanding messaging as a customer service option. It's not sufficient to have a customer service phone number where the customer can call you, but it's becoming almost a must that customers should be able to reach you through some kind of real-time messaging platform as well. Users are demanding fast-paced interaction and quick answers.
Recent studies found that messaging and chat were the highest rated contact methods for customer satisfaction. Refer to https://onereach.com/blog/45-texting-statistics-that-prove-businesses-need-to-start-taking-sms-seriously/ .
According to recent polls ( http://customerthink.com/7-data-backed-reasons-why-you-should-let-customers-text-customer-service/ ), almost two-thirds of consumers are likely to have a positive perception of an organization that offers messaging or chat as a service channel. Nevertheless, by the end of 2016, roughly 40% of customer service centers will still be missing that opportunity to impress their customers. This translates not only into failing to impress your customers, but also as a loss of business opportunities. Customers are likely to be more loyal and stay with those organizations that are capable of interacting and engaging with them in faster and smarter ways. Refer to https://blog.kissmetrics.com/live-chat/ .
Consider your organization (corporate) has a messaging app that allows your customers to interact with you. Even though your app might be a great communication gateway, there's still no room for that communication channel to be lost. Say, for instance, a user forgets to turn on notifications or accidentally deletes the app. The ability to seamlessly and easily communicate is suddenly gone.
However, using a personal messaging app (such as Skype, Facebook Messenger, WhatsApp, and so on) eliminates most roadblocks, allowing for companies to become part of the communication framework that users already know and love.
With messaging apps, there are no forms, no downloads, no new platforms. The customer can use the interface that they are already familiar with to instantly engage with your organization. The user can use natural language to purchase a ticket, download a boarding pass, or ask a question. Moreover, given that the user is highly unlikely to stop using the messaging app, your organization can follow up with updates, surveys, and other notifications through the messaging app that the user already knows and loves.
In order to understand this better, say when a consumer asks a question, the bot should be able to:
There will surely be cases where bots might encounter situations that require the nuance and analytical thinking of a human. When they do, they can escalate to an agent, passing along the context they've gathered during the interaction to ensure a seamless customer experience. In principle, this should be totally transparent for the end user.
As technology continues to advance, Gartner predicts that by 2018, bots should be able to recognize customers by face and voice rather seamlessly.
Bots could also be able to:
Smart phones are becoming more important in today's world. Arguably, they are almost an extension of yourself. If you lose your phone today, you are in trouble. Everything from e-mails, calendar, messaging, banking, and even your wallet are somehow linked to your phone.
In today's vibrant, dynamic, and always connected society, having access to vast amounts of information at your fingertips through your phone can be a blessing, but it can also be a curse.
Busy professionals nowadays have to deal with hundreds of e-mails on a daily or weekly basis, plus also many messages and notifications from social networks such as Twitter and LinkedIn. Keeping up with this sheer volume of messages can be overwhelming.
But what if phones could actually help us alleviate some of this information overload by notifying us of important things or allowing us to perform custom actions based on SMS or voice commands? Imagine if we were able to automate certain processes through messaging or voice. Wouldn't that be awesome?
Before social networks took off, Short Message Service (SMS) was the most common way to exchange short messages between people.
According to Wikipedia, even though SMS is still strong and growing, social networking messaging services such as Facebook Messenger, WhatsApp, Skype, and Viber, available on smart phones, are increasingly being used to exchange short messages.
