This article shows you how to build a bot by using the Python Echo Bot template, and then how to test it with the Bot Framework Emulator.
Creating a bot with Azure Bot Service and creating a bot locally are independent, parallel ways to create a bot.
- Python 3
- Bot Framework Emulator
- Knowledge of asynchronous programming in Python
- Install the necessary packages by running the following commands:
pip install botbuilder-core pip install asyncio pip install aiohttp pip install cookiecutter
The last package, cookiecutter, will be used to generate your bot. Verify that cookiecutter was installed correctly by running
- To create your bot run:
This command creates an Echo Bot based on the Python echo template
Start your bot
From a terminal navigate to the
echo-botfolder where you saved your bot. Run
pip3 install -r requirements.txtto install any required packages to run your bot.
Copy the last for digits in the address on the last line (usually 3978) since you will be using them in the next step. You are now ready to start the Emulator.
Start the Emulator and connect your bot
Start the Bot Framework Emulator.
Select Open Bot on the Emulator's Welcome tab.
Enter your bot's URL, which is the URL of the local port, with /api/messages added to the path, typically http://localhost:3978/api/messages.
Send a message to your bot, and the bot will respond back.