public Task <bool> ContinueTopic(MultiBotContext context) { switch (context.Activity.Type) { case ActivityTypes.Message: switch (context.RecognizedIntents.TopIntent?.Name) { case "demoCards": // switch to card demos context.ConversationState.ActiveTopic = new DemoCardsTopic(); return(context.ConversationState.ActiveTopic.StartTopic(context)); case "luisDemo": // switch to LUIS Demos context.ConversationState.ActiveTopic = new DemoLUISTopic(); return(context.ConversationState.ActiveTopic.StartTopic(context)); case "help": // show help DefaultResponses.ReplyWithHelp(context); return(Task.FromResult(true)); default: // show our confusion DefaultResponses.ReplyWithConfused(context); return(Task.FromResult(true)); } default: break; } return(Task.FromResult(true)); }
/// <summary> /// Continue the topic, method which is routed to while this topic is active /// </summary> /// <param name="context"></param> /// <returns></returns> public Task <bool> ContinueTopic(IBotContext context) { var activeTopic = (ITopic)context.State.ConversationProperties[ConversationProperties.ACTIVETOPIC]; switch (context.Request.Type) { case ActivityTypes.Message: switch (context.TopIntent?.Name) { case "addAlarm": // switch to addAlarm topic activeTopic = new AddAlarmTopic(); context.State.ConversationProperties[ConversationProperties.ACTIVETOPIC] = activeTopic; return(activeTopic.StartTopic(context)); case "showAlarms": // switch to show alarms topic activeTopic = new ShowAlarmsTopic(); context.State.ConversationProperties[ConversationProperties.ACTIVETOPIC] = activeTopic; return(activeTopic.StartTopic(context)); case "deleteAlarm": // switch to delete alarm topic activeTopic = new DeleteAlarmTopic(); context.State.ConversationProperties[ConversationProperties.ACTIVETOPIC] = activeTopic; return(activeTopic.StartTopic(context)); case "help": // show help DefaultResponses.ReplyWithHelp(context); return(Task.FromResult(true)); default: // show our confusion DefaultResponses.ReplyWithConfused(context); return(Task.FromResult(true)); } default: break; } return(Task.FromResult(true)); }
/// <summary> /// Continue the topic, method which is routed to while this topic is active /// </summary> /// <param name="context"></param> /// <returns></returns> public async Task <bool> ContinueTopic(AlarmBotContext context) { switch (context.Activity.Type) { case ActivityTypes.Message: switch (context.RecognizedIntents.TopIntent?.Name) { case "addAlarm": // switch to addAlarm topic context.ConversationState.ActiveTopic = new AddAlarmTopic(); return(await context.ConversationState.ActiveTopic.StartTopic(context)); case "showAlarms": // switch to show alarms topic context.ConversationState.ActiveTopic = new ShowAlarmsTopic(); return(await context.ConversationState.ActiveTopic.StartTopic(context)); case "deleteAlarm": // switch to delete alarm topic context.ConversationState.ActiveTopic = new DeleteAlarmTopic(); return(await context.ConversationState.ActiveTopic.StartTopic(context)); case "help": // show help await DefaultResponses.ReplyWithHelp(context); return(true); default: // show our confusion await DefaultResponses.ReplyWithConfused(context); return(true); } default: break; } return(true); }