- Get the C# bot template from this link:
- Save the zip file (don't decompress it) in your Vistual Studio templates directory, which by default is:
%USERPROFILE%\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#"
A new bot is now there for you! If you want to see its code, using the solution explorer, open the 'Controllers\MessagesController.cs' file.
4. Register A Bot
- Go to https://dev.botframework.com/ and sign in with your account.
- Fill in the Endpoint, using your bot URL and adding/api/messages to the end. Also set the protocol to https instead of http. Your Botu Privacy URL should point to an informative page, so for the time being you can point it to anywhere.
- It's up to you to decide if you want the bot to listen to all messages and if you want to use translation when required. Specify an App ID for your bot, it must be unique, so you may need to change it if you are asked to when trying to register it.
- After the bot has been created, you will be sent to a screen with several sections. At the left you will see a "Details" section. It includes your App Id and a Primary app secret string that has been created for you. Click on the Show link under it so you can see it and copy it.
- In Visual Studio, open the Web.config file, and replace the values of the iand AppSecret strings with the information obtained from the website. Save the file.
- Publish again to Microsoft Azure
Finally, we have to set up the communication channels we want.
- Go to the Bot Framework portal and select your bot.
- You will see an interesting list of channels:
- Let's configure the Web Chat, which will allow you to embed it in your website. So, click on the Edit link next to it.
- Click on the Generate Web Chat Secret button.
- ow copy the Embed Template text and place it in your html. If you want to try it out without embedding it somewhere else, just copy the src string from the embed template. For example, for me, it is:
- Replace the YOUR_SECRET_HERE string for the text shown in the Secret box.
- Open the produced URL in a browser and you should see a chat where you can talk to your bot!
- (Chinese) https://dotblogs.com.tw/maduka/2016/06/24/113852
- (Channel 9)https://channel9.msdn.com/Blogs/MVP-Windows-Dev/Microsoft-Bot-Framework