These examples show a simple "Hello World" sample for each bot type supported by the microsoft bot framework. Below is a code sample about how you can use it. I tried with the ASP.NET MVC application.
[BotAuthentication]
public class VendaController: ApiController
{
public async Task < HttpResponseMessage > Post([FromBody] Activity activity)
{
await Conversation.SendAsync(activity, () => new TestDialog());
return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);
}
}
[Serializable]
public class TestDialog: IDialog < object >
{
public async Task StartAsync(IDialogContext context)
{
context.Wait(MessageReceivedATask);
}
public async Task MessageReceivedATask(IDialogContext context, IAwaitable < IMessageActivity > argument) {
if (message.Text == "start") {
await context.PostAsync("Hello world!");
context.Wait(MessageReceivedATask);
} else if (message.Text = "change language") {
PromptDialog.Choice(context, SelectLanguage, new List < string > () {
"English",
"Français",
"Persian"
}, "please select your language");
}
}
}
