Professional Documents
Culture Documents
Construccion de Bot Paso A Paso
Construccion de Bot Paso A Paso
1. Microsoft Account (Hotmail, Live, Outlook.com) to log into the Bot Framework developer
portal, which you will use to register your Bot.
2. An Azure-accessible REST endpoint exposing a callback for the Connector service.
3. Developer accounts on one or more communication services (such as Skype) where your
Bot will communicate.
In addition you may wish to have an Azure App Insights account so you can capture telemetry from
your Bot. There are different ways to go about building a Bot; from scratch, coded directly to the
Bot Connector API, the Bot Builder SDK's for Node.JS & .NET, and the Bot Connector .NET
template which is what this QuickStart guide demonstrates .
if (activity.Type == ActivityTypes.Message)
{
switch (activity.Text.ToUpper())
{
case "PIZZA":
{
// return our reply to the user
case "TOPPING":
{
case "CHECKOUT":
{
Activity reply = activity.CreateReply("Thank you for the order. Good bye");
await connector.Conversations.ReplyToActivityAsync(reply);
break;
}
default:
}
else
{
HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
Emulator
Use the Bot Framework Emulator to test your Bot application
The Bot Framework provides a channel emulator that lets you test calls to your Bot as if it were
being called by the Bot Framework cloud service. To install the Bot Framework Emulator,
download it from https://aka.ms/bf-bc-emulator.
When the application is built and deployed the web browser will open and display the application
Default.htm file (which is part of the Bot Application project). Feel free to modify the Default.html
file to match the name and description of your Bot Application.
When using the emulator to test your Bot application, make note of the port that the application is
running on, which in this example is port 3978. You will need this information to run the Bot
Framework Emulator.
Now open the Bot Framework Emulator. There are a few items that you will need to configure in
the tool before you can interact with your Bot Application.
When working with the emulator with a bot running locally, you need:
The Url for your bot set the localhost:<port> pulled from the last step. > Note: will need to
add the path "/api/messages" to your URL when using the Bot Application template.
Empty out the MicrosoftAppId field
Empty out the MicrosoftAppPassword field
This will only work with the emulator running locally; in the cloud you would instead have to specify
the appropriate URL and authentication values. For more about the emulator, read here.
Now that everything is configured you can interact with your service. The bottom of the Bot
Framework Emulator application has a Text Box that you can use to enter a message to interact
with the bot you just created.
If we take a look at the code in the Bot Application that was generated by the Visual Studio 2015
Bot Application Template, specifically the file called MessageController.cs we can see how the
message entered by a user is converted into the reply Activity.