我一直在尝试使用 html 上的这段代码通过 DirectLine 连接到我的机器人。
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
</head>
<body>
<div id="bot"/>
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
<script>
BotChat.App({
directLine: { secret: 'xxxxx' },
user: { id: 'userid' },
bot: { id: 'botid' },
resize: 'detect'
}, document.getElementById("bot"));
</script>
</body>
</html>
我已经检查了直线 secret ,没问题。当我测试这段代码时,聊天出现了,我收到了你好!我在机器人上设置的消息,但是当我尝试向机器人发送消息时,我在 Web 浏览器的控制台上收到此错误
我如何才能正确使用 DirectLine 或者我在发送消息的代码中缺少什么?
最佳答案
我检查了 Azure status history并发现 6/14 出现了 bot 服务问题,这可能导致与 bot 的通信无法按预期工作。
关于javascript - Bot框架直线502错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50868674/