Hello there! Are you interested in creating your own .NET bot? I hope you are! This is the second part of a blog post telling you everything about Microsoft bots. In case you missed part 1, follow the link.
If you have already read the first part and you’ve got a wonderful little .NET bot at your disposal, let’s continue. First of all, thanks for reading on. Nothing feels better than creating a useful blog post. Second of all, let me show what you’re about to read. Three steps for going from a basic bot to a true AI machine:
- Bringing Your .NET Bot to life
- Connecting the bot to channels
- Giving your Bot a voice
Bringing your .NET Bot to life
As mentioned before, you’re not starting from a blank page here. You already have a pretty sophisticated bot that uses LUIS service for brains. Now is the time to show your bot to the world. You need to deploy it, and what’s more important, test it beforehand.
For testing purposes, it’s better to use ngrok or any similar tool that secures tunnels to your localhost. Oh, and don’t be alarmed when your bot is a little bit ‘slow’ during your tests. The time lag when your bot is answering your questions will not be present when deployed.
When you get tired testing, you’ll know it’s time—time to deploy the bot! There are two ways of dealing with the deployment:
1. Use Azure—this is an out-of-the-box solution from Microsoft. It has a free trial available for a month. Furthermore, it’s not that expensive… Only about 10 dollars a month for a basic hosting of your one and only bot. However, if you need rough numbers, Microsoft has a wonderful calculator (link).
2. Do it yourself (DIY)—this one is always an option. To make it work, you need 3 things:
- Your own server or an affordable third-party vendor
- To make sure your bot has an Internet-accessible endpoint
- A valid HTTPS certificate available
You’re almost set and done. Still, before we move on, you need to register your bot in the Bot Framework Portal. Small tip: when you generate Microsoft App credentials, make sure you’ve copied and securely stored the app password. There’s no way of restoring your lost password here. So, you may end up losing the whole Bot Framework account. And you don’t want that!
Connecting the bot to channels
Finally, your bot is alive and breathing. I guess, he should start doing his job—interacting with people. There are a dozen places where you can publish it: Bing, Cortana, Messenger, Skype, etc. Two choices are pre-configured for you—Skype and Web Chat. However, if you don’t find a channel here that suits you, there’s always a custom API available.
Well, let’s go through all the available channels:
1. Skype—It’s a default channel providing only simple one-to-one messaging from the start. Nevertheless, you can configure web control, group chatting and calling. As for the calls, you have two choices: Interactive voice response—This option is limited to audio. Moreover, there’s no group call option for now. Real-time media—This option has the chat and the group call options. However, it’s not interactive at any level. In order to use Real-time media capability, you need to download and apply Bot.Builder.RealTimeMediaCalling SDK and Microsoft.Skype.Bots.Media lib.
2. Web-chat—It’s also a default channel that has only a simple chatting option. In Microsoft Bot Framework, you can generate a piece of code that you can add to almost any website. Simple and useful.
3. Facebook Messenger—It requires a Facebook company page, and I wonder whether there’s a business in the world without one. On your FB page, you should enable your Messenger app and grab all the configurations for your channel.
4. Telegram—This one’s simple! You have to register your bot with@BotFather.
5. Bing—Users can interact with your bot directly in the Bing search results page. This is very healthy for your general SEO strategy and any keywords that you might want to associate your bot with.
6. Cortana—Your bot can be added to Cortana skills. However, bear in mind that your bot should be designed both for speech and text in order to be connected with Cortana.
7. Email—Connecting to this old school channel can also prove useful. However, your .NET bot can only communicate with users via Office 365.
8. Additional Channels—GroupMe, Kik, Microsoft Teams & Twilio. Sorry, I’m not giving you a description of these channels for a simple reason. As the author of the article, I’ve never used any of them, and I’m no authority on the subject.
9. Direct Line (Custom API)—This is basically a REST API you can use to build a channel for any communication platform that’s not already available. You can find detailed features of the Direct API in this link.
It’s your marketing genius that should decide which channels to use and which to ignore. Know where your target audience lives. Create a bot specifically for them and their needs, and you’re one step closer to success. Finally, your bot will bring you value, and maybe even some profit.
Giving your bot a voice
You have a pretty sophisticated bot on your hands that’s getting smarter and smarter with every conversation. However, at this point, he’s only good for a silent chatbox. No worries, we can make him talk! We can make him talk with the help of the Bot Builder Calling SDK. Step by step, setting up each and every element of the SDK.
For the detailed instructions, please follow the link to a wonderful @ankitbko blog post: Skype Call your bot—Microsoft Bot Framework with Bing Speech.
All in all, I hope you enjoyed reading or skimming through, whatever you prefer! Ideally, at the end of the blog post, you should come up with a bot like this one: Trivia Chatbot.
In case you need additional help with anything written above or with the documentation for the .NET Bot Framework, or if everything written above seems to be rocket science to you, you can always address DevCom with the request here.
Author: Oleh Romanyuk, Marketing Manager @DevCom-custom software development company.