Exemplo n.º 1
0
        public JsonResult chatbot(string text, string group)
        {
            string result = "";

            AIMLbot.Result res = _bot.Chat(text);

            bool isMatch = true;

            //AIMLbot.Request r = new Request(text, user, bot);
            //AIMLbot.Result res = bot.Chat(r);

            result = res.OutputSentences[0].ToString();
            if (result.Contains("NOT_MATCH"))
            {
                isMatch = false;
                result  = CauHoiLienQuan(text, group);
                if (String.IsNullOrEmpty(result))
                {
                    //result = NOT_MATCH[res.OutputSentences[0]];
                    result = res.OutputSentences[0].ToString();
                }
            }
            return(Json(new { message = res.OutputHtmlMessage, postback = res.OutputHtmlPostback, messageai = result, isCheck = isMatch }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
 private String Answer(GroupMessage message)
 {
     return(botService.Chat(message));
 }