Skip to content

Latest commit

 

History

History
 
 

09.message-routing

message-routing bot

This bot has been created using Microsoft Bot Framework,

This samples shows how to:

  • Handle user interruptions for such things as Help or Cancel
  • Prompt for and validate requests for information from the user

To try this sample

  • Clone the repository
    git clone https://github.com/microsoft/botbuilder-samples.git
  • In a terminal, navigate to javascript_nodejs/09.message-routing
    cd javascript_nodejs/09.message-routing
    • [Optional] Update the .env file under samples/javascript_nodejs/09.message-routing with your botFileSecret For Azure Bot Service bots, you can find the botFileSecret under application settings.
  • Install modules
    npm install
  • Create required services
  • Run the sample
    npm start

Testing the bot using Bot Framework Emulator

Microsoft Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

  • Install the Bot Framework Emulator from here

Connect to bot using Bot Framework Emulator v4

  • Launch Bot Framework Emulator
  • File -> Open Bot Configuration and navigate to javascript_nodejs/09.message-routing folder
  • Select message-routing.bot file

Further Reading

Additional Resources

Dependencies

  • Restify Used to host the web service for the bot, and for making REST calls
  • dotenv Used to manage environmental variables

Project Structure

index.js references the bot and starts a Restify server. bot.js loads the dialog type you selected when running the generator and adds it as the default dialog. dialogs.js contains the list of sample dialogs.

Configuring the bot

Update .env with the appropriate keys:

  • App ID and Key for registered bots.

Running the bot

node ./index.js

Developing the bot

nodemon ./index.js