/// <summary> /// 文字类型请求 /// </summary> /// <param name="requestMessage"></param> /// <returns></retturns> public override IResponseMessageBase OnTextRequest(RequestMessageText requestMessage) { var responseMessage = base.CreateResponseMessage <ResponseMessageText>(); responseMessage.Content = MSBot.PostMessage(requestMessage.Content).Result;//用bot框架实现 //responseMessage.Content = LuisAPI.PostMessage(requestMessage.Content);//用Luis实现 return(responseMessage); }
/// <summary> /// 语音类型请求 /// </summary> /// <param name="requestMessage"></param> /// <returns></returns> public override IResponseMessageBase OnVoiceRequest(RequestMessageVoice requestMessage) { var responseMessage = base.CreateResponseMessage <ResponseMessageText>(); if (!string.IsNullOrEmpty(requestMessage.Recognition)) { responseMessage.Content = MSBot.PostMessage(requestMessage.Recognition).Result; } else { responseMessage.Content = "小哈没听清您说的是什么!"; } return(responseMessage); }