One of the coolest features that Microsoft present during last months was a Bot platform. At almost the same time other providers like Facebook also have presented their own version of bots, so is something that you must try in the near future.
The official description is:
The Microsoft Bot Framework Connector is a communication service that helps you connect your Bot with many different communication channels (GroupMe, SMS, email, and others). If you write a conversational Bot or agent and expose a Microsoft Bot Framework-compatible API on the internet, the Connector will forward messages from your Bot to a user, and will send user messages back to your Bot.
So basically we are dealing with a smart communication class, which is later hosted in an Azure environment and automatically connected with tons of providers. The latest part is the cool one.
If we want to create the basic structure of a bot, we can download the following template (link) and add this one into our Visual Studio 2015 projects. To do this, we need to copy the zip file in the templates directory [%USERPROFILE%\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#]
Now in Visual Studio 2015, we have a new project template. Let’s create a sample project
At this moment we can build and use the project in local mode. The main class in the project is the MessagesController class
This class receives a message text for the user, and then it creates a replyMessage using the CreateReplyMessage function. We can also perform authentication using credentials over HTTPS, using the decoration [BotAuthentication]
Now, is we run our bot framework project we’ll see that is hosted by default in [http://localhost:3978/]
In order to test the project we can use the Microsoft Bot Framework Emulator app. You can download the app from here.
And that’s it, we can write a sample message in the chat window, and the bot will return the amount of chars of the message
And that’s the sample hello world project we can create with the bot framework. Next steps will be the publish of this bot in the Azure environment to test it from one of the supported channels.
Greetings @ Toronto