【发布时间】:2017-10-26 13:55:23
【问题描述】:
我开始调查 BotFramework 并遇到了一个烦人的问题。
-
创建了“Hello world”机器人。
这里如果代码public async Task<HttpResponseMessage> Post([FromBody]Activity activity) { if (activity.Type == ActivityTypes.Message) { ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl)); // calculate something for us to return int length = (activity.Text ?? string.Empty).Length; // return our reply to the user Activity reply = activity.CreateReply($"You sent {activity.Text} which was {length} characters"); await connector.Conversations.ReplyToActivityAsync(reply); } else { HandleSystemMessage(activity); } var response = Request.CreateResponse(HttpStatusCode.OK); return response; }
在本地运行良好
- 在 Azure 上部署它。
- 在 web.config 中设置正确的 BotId、MicrosoftAppId 和 MicrosoftAppPassword 参数。
- 我的机器人的 URL 是 http://funnyskypebot20171026010946.azurewebsites.net,它看起来可以正常工作
但是当我尝试通过 Bot Framework Channel Emulator 与位“通信”时,我没有收到任何回复... 有什么问题?请指教。
【问题讨论】:
-
模拟器日志面板中是否出现任何错误?
-
@stuartd 没有。我在模拟器面板中没有任何错误
-
你的机器人句柄是什么?
-
你可以试试 https 端点吗?
-
@KienChu 我已经试过了。结果是一样的。如果没有任何详细信息,则无法发送消息出了什么问题以及发生了什么
标签: c# botframework