Simple implementation of the Bot Framework
Recently, Microsoft released the Bot Framework. After checking some information, it tried to write a piece of code. To facilitate development, someone has created a development template for the Bot Framework. You can download it by yourself. After the download is complete, copy Bot Application.zip to "% USERPROFILE % \ Documents \ Visual Studio 2015 \ Templates \ ProjectTemplates \ Visual C #", as shown in
Open VS2015. In the C # project, you can find the template of the Bot Application and click Create.
Find MessagesController. cs in the Controllers folder, and delete "BotAuthentication" above it to skip the verification during request initiation.
Open web. config and fill in AppId and AppSecret. The guid can be used for these two values.
Publish the project to the local IIS and configure a port, for example, 20080.
Use the ngrok tool to expose the local site to the Internet.
You can see that the local port 20080 has been configured on the http://1aea0e3a.ngrok.io and https://1aea0e3a.ngrok.io. You can access the local website directly. This method can also be used in development.
With this URL, we can register a bot.
Log on to https://dev.botframework.com and click Get Start to register.
When registering, you must have a Microsoft account to log on and then agree to the authorization. Enter relevant information in the interface,
After filling in the information, save and generate your own Bot, as shown in figure
Click Edit to enter and set app secret
A Send page is displayed on the page after the successful registration of the Bot, which can initiate a request, as shown in figure
You can see that you have received feedback, and you can also see the status in ngrok.
Because the web site generated by ngrok is invalid after a period of time or is not used, it needs to be generated again and then configured to the bot.
On the Bot interface, you can click Get bot embed codes to obtain the embedded code. For example.