<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prabhu Manoharan</title>
    <description>The latest articles on DEV Community by Prabhu Manoharan (@prabhumanoharaa).</description>
    <link>https://dev.to/prabhumanoharaa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F595424%2Fa42a9e51-c4dd-49c0-89f7-629657bbd5ee.jpeg</url>
      <title>DEV Community: Prabhu Manoharan</title>
      <link>https://dev.to/prabhumanoharaa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prabhumanoharaa"/>
    <language>en</language>
    <item>
      <title>Create a Azure bot in Python</title>
      <dc:creator>Prabhu Manoharan</dc:creator>
      <pubDate>Mon, 15 Mar 2021 16:12:49 +0000</pubDate>
      <link>https://dev.to/prabhumanoharaa/create-a-azure-bot-in-python-4aa9</link>
      <guid>https://dev.to/prabhumanoharaa/create-a-azure-bot-in-python-4aa9</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Creating a bot with Azure Bot Service and creating a bot locally are independent, parallel ways to create a bot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python 3&lt;/li&gt;
&lt;li&gt;Bot Framework Emulator&lt;/li&gt;
&lt;li&gt;Knowledge of asynchronous programming in Python&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Templates&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the necessary packages by running the following commands:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;botbuilder&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;core&lt;/span&gt;
&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;
&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;aiohttp&lt;/span&gt;
&lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;cookiecutter&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last package, cookiecutter, will be used to generate your bot. Verify that cookiecutter was installed correctly by running &lt;code&gt;cookiecutter --help&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To create your bot run:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;cookiecutter&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;microsoft&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;BotBuilder&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Samples&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;releases&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;download&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Templates&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;zip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates an Echo Bot based on the Python echo template&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a bot&lt;/strong&gt;&lt;br&gt;
You will be prompted for the name of the bot and a description. Name your bot &lt;code&gt;echo-bot&lt;/code&gt; and set the description to &lt;code&gt;A bot that echoes back user response&lt;/code&gt;. as shown below:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgx011bb8ics1y60q1x28.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgx011bb8ics1y60q1x28.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start your bot&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;From a terminal navigate to the &lt;code&gt;echo-bot&lt;/code&gt; folder where you saved your bot. Run &lt;code&gt;pip3 install -r requirements.txt&lt;/code&gt; to install any required packages to run your bot.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the packages are installed run &lt;code&gt;python3 app&lt;/code&gt; to start your bot. You will know your bot is ready to test when you see the last line shown in the screenshot below:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6mvonv54shuw583nfln.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6mvonv54shuw583nfln.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start the Emulator and connect your bot&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Start the Bot Framework Emulator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select Open Bot on the Emulator's Welcome tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter your bot's URL, which is the URL of the local port, with /api/messages added to the path, typically &lt;a href="http://localhost:3978/api/messages" rel="noopener noreferrer"&gt;http://localhost:3978/api/messages&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbeylks5hdvj89xooydgd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbeylks5hdvj89xooydgd.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then select Connect.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvrwr7a22lynqn5jowzr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvrwr7a22lynqn5jowzr.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Send a message to your bot, and the bot will respond back.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>python</category>
    </item>
  </channel>
</rss>
