Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Ezequiel Jadib 6b3df2c0b3
Update documentation links to point to new docs (#118)
7 years ago
..
74eb448cde
[Node] Update Emulator screenshots
7 years ago
7a204678e3
Node - Move environment vars for development to .env files
7 years ago
6b3df2c0b3
Update documentation links to point to new docs (#118)
7 years ago
3b8f26a2fb
Node - Samples ES5 compliant
7 years ago
a2a0e1baa1
update azuredeploy.json paths
7 years ago
28d163ecf6
[Node] Update to botbuilder 3.7.0 (#50)
7 years ago

README.md

You have to be logged in to leave a comment. Sign In

Create New Conversation Bot Sample

A sample bot that starts a new conversation using a previously stored user address.

Deploy to Azure

Prerequisites

The minimum prerequisites to run this sample are:

  • Latest Node.js with NPM. Download it from here.
  • The Bot Framework Emulator. To install the Bot Framework Emulator, download it from here. Please refer to this documentation article to know more about the Bot Framework Emulator.
  • [Recommended] Visual Studio Code for IntelliSense and debugging, download it from here for free.

Code Highlights

Bot Builder uses dialogs to model a conversational process, the exchange of messages, between bot and user. bot.beginDialog() can be used to proactively start a new dialog to interact with the user. Because, an address is required to initiate a new conversation, this user address should be saved during any previous conversation with the user. Any current conversation between the bot and user will be replaced with a new dialog stack. Alternatively, bot.send() can be used to send a message without starting a dialog.

// this is the object we should persist if we want to create a new conversation anytime later
// copy it without the conversationId 
var address = session.message.address;
delete address.conversation;

// (then, on another scope)

// start survey dialog using stored address
bot.beginDialog(address, 'survey');

Outcome

You will see the following when connecting the Bot to the Emulator and send it a message.

Sample Outcome

On the other hand, you will see the following in Skype.

Sample Outcome

More Information

To get more information about how to get started in Bot Builder for Node and Dialogs please review the following resources:

LimitationsThe functionality provided by the Bot Framework Activity can be used across many channels. Moreover, some special channel features can be unleashed using the Message.sourceEvent method.

The Bot Framework does its best to support the reuse of your Bot in as many channels as you want. However, due to the very nature of some of these channels, some features are not fully portable.

The features used in this sample are fully supported in the following channels:

  • Skype
  • SMS
  • Slack
  • Email

They are also supported, with some limitations, in the following channel:

  • Telegram

On the other hand, they are not supported and the sample won't work as expected in the following channels:

  • Facebook
  • Microsoft Teams
  • DirectLine
  • WebChat
  • Kik
  • GroupMe
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...