This topic is for the latest release of the SDK (v4). You can find content for the older version of the SDK (v3) here.
Creating a bot with Azure Bot Service and creating a bot locally are independent, parallel ways to create a bot.
- Visual Studio Code
- Yeoman, which uses a generator to create a bot for you
- Bot Framework Emulator
The install of Windows build tools listed below is only required if you use Windows as your developemnt operating system. For some installations the install step for restify is giving an error related to node-gyp. If this is the case you can try running this command with elevated permissions. This call may also hang without exiting if python is already installed on your system:
npm install -g windows-build-tools
Create a bot
To create your bot and initialize its packages
Open a terminal or elevated command prompt.
mkdir myJsBots cd myJsBots
Ensure your version of npm is up to date.
npm install -g npm
npm install -g yo generator-botbuilder
Then, use the generator to create an echo bot.
Yeoman prompts you for some information with which to create your bot. For this tutorial, use the default values.
- Enter a name for your bot. (myChatBot)
- Enter a description. (Demonstrate the core capabilities of the Microsoft Bot Framework)
- Choose the template to use. (Echo)
Thanks to the template, your project contains all of the code that's necessary to create the bot in this quickstart. You won't actually need to write any additional code.
Start your bot
In a terminal or command prompt change directories to the one created for your bot, and start it with
npm start. At this point, your bot is running locally.
Start the Emulator and connect your bot
- Start the Bot Framework Emulator.
- Click the Open Bot link in the emulator "Welcome" tab.
- Select the .bot file located in the directory where you created the project.
Send a message to your bot, and the bot will respond back with a message.
See tunneling (ngrok) for how to connect to a bot hosted remotely.
Would you like to provide feedback?
Our feedback system is built on GitHub Issues. Read more on our blog.