Open Visual Studio and select File, then New, then Project Choose Template Echo Bot
In the The project will be created as below. dialog, select the , name the project and click .
Open StockBot.cs and refer OnTurnAsync method. This method will be called whenever the end-user communicates with the BotService
The Stock Bot will ask user to enter the Ticker of Stock to show the stock details. To achieve it add a Service call to get the Stock details. For this example I have created a Web API Service using ASP.NET Core 2.2 and hosted in Azure. The below code will consume the Service and return the Stock Details for the Ticker. How to create a WebAPI and Host in Azure will be provided in a different DIY article in my Blog.
Make the below change to OnTaskAsync Method. This will prompt the user to enter the Ticket of Stock
Test the StockBot locally using Emulator. If not installed Bot Framework Emulator v4 (latest version available as of now!)
Open the Emulator and choose the StockBot.bot file from the Project folder path as showed below.
Open the StockBot.bot file.
Leave the Microsoft App Id and Microsoft App Password blank and click Connect. The Emulator will show a screen as showed below.
Enter the Ticker of your stock. Eg: AAPL
StockBot prompts user to enter next Ticker. Further you can enter multiple Ticker to test the Bot service.
What’s Next? Deploy StockBot to Azure and integrate to Website and Skype.