Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Bots with Microsoft Bot Framework

You're reading from  Building Bots with Microsoft Bot Framework

Product type Book
Published in May 2017
Publisher Packt
ISBN-13 9781786463104
Pages 424 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Kishore Gaddam Kishore Gaddam
Profile icon Kishore Gaddam
Toc

Table of Contents (10) Chapters close

Preface 1. Setting up Microsoft Bot Framework Dev Environment 2. Developing Your First Bot Using the Connector and Builder SDK 3. Developing WeatherBot Using Dialogs and LUIS 4. Natural Speech and Intent Processing Bot Using Microsoft Cognitive Services 5. Developing Bots Using LUIS Prompt Dialogs with State and Nearby Bot Using Custom APIs 6. Developing an IVR Bot for a Bank Using Advanced Microsoft Bot Framework Technologies 7. Intelligent Bots with Microsoft Bot Framework and Service Fabric 8. Developing Intelligent Facial Expression Identification Bot for IoT Using Azure and Power BI 9. Publishing a Bot to Skype, Slack, Facebook, and the GroupMe Channel

How to use dialogs in bot applications

Now, we will see how to use dialogs for the same Hello World bot application.

Dialogs will be used in a conversational process, where there is an interaction or exchange of messages between the user and the bot. Each dialog is an abstraction that encapsulates its own state in a C# class that implements IDialog. To work with dialogs, we need to import the Microsoft.Bot.Builder.Dialogs namespace. Add a C# class HelloWorldDialog into your project. To add a class, right-click on your project and navigate to Add | Class... from the menu:

Figure 16: Using Visual Studio IDE to add a new class to an existing project

Give the Name as HelloWorldDialog:

Figure 17: Using Visual Studio IDE to name a new class

In order to change the Hello World example, add the following code in HelloWorldDialog. To use the Bot Builder, we first need to import the required namespace:

using Microsoft.Bot...
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 €14.99/month. Cancel anytime