Exemplo n.º 1
0
        private async Task MenuOption(IDialogContext context, IAwaitable <string> result)
        {
            var res = await result;

            string menu_response = API_AI_Logger.API_Response(res);

            await context.PostAsync(menu_response);

            context.Call(child: new TicketModel(), resume: childDialogcomplete);
        }
Exemplo n.º 2
0
        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable <object> result)
        {
            var activity = await result as Activity;

            // Calculate something for us to return
            //int length = (activity.Text ?? string.Empty).Length;

            // Return our reply to the user
            //await context.PostAsync($"You sent {activity.Text} which was {length} characters");

            string response        = API_AI_Logger.API_Response(activity.Text);
            string action_response = API_AI_Logger.API_Connection_Action(activity.Text);

            await context.PostAsync(response);

            if (action_response.Contains("RaiseTicket-next"))
            {
                //NextCall(context);
                PromptDialog.Confirm(
                    context,
                    resume: ResponseOption,
                    prompt: "Do you wish to check that out",
                    retry: retry_response
                    );
            }

            else if (action_response.Contains("RaiseTicket-repeat"))
            {
            }

            else
            {
                PromptDialog.Text(
                    context,
                    resume: MenuOption,
                    prompt: "I can \n \n 1. Raise an incident ticket. \n \n 2. Check the status of previous raise ticket.",
                    retry: "Please try agin, as some problem occured");
            }


            //context.Wait(MessageReceivedAsync);
        }