Ejemplo n.º 1
0
        private async Task MessageQnA(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var     question = await result;
            dynamic ans      = await GetQnAAPI.Post(question.Text);

            string ans2 = ans["answers"][0]["answer"];

            if (ans2 == "No good match found in KB.")
            {
                await context.PostAsync("No good match found for your question, Please try again.");

                context.Wait(MessageQnA);
            }
            else
            {
                PromptDialog.Choice(context, this.OnSolveSelect, yesNoOptions, ans2, "Have no your choice", 3);
            }
        }
Ejemplo n.º 2
0
        private async Task MessageQnA(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var     question = await result;
            dynamic ans      = await GetQnAAPI.Post(question.Text);

            string ans2 = ans["answers"][0]["answer"];

            if (ans2 == "No good match found in KB.")
            {
                await context.PostAsync("ไม่พบคำถามของท่าน กรุณาใส่คำถามของท่านใหม่");

                context.Wait(MessageQnA);
            }
            else
            {
                PromptDialog.Choice(context, this.OnSolveSelect, yesNoOptions2, ans2, "กรุณาเลือกอีกครั้ง", 3);
            }
        }