Olu*_*ola 2 botframework direct-line-botframework
<!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: direct_line_secret },
user: { id: 'userid' },
bot: { id: 'botid' },
resize: 'detect'
}, document.getElementById("bot"));
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我有这样的代码嵌入机器人的使用直接行API,而不是通常的iframe实时聊天,但是当我把我的directline私有密钥,机器人占据整个网页.我需要它显示在网页的右下角,当用户点击它时弹出为生活聊天.请有人指导我实现这一目标.谢谢
您的问题是关于您显示div的方式,包括机器人: <div id="bot"/>
您可以将此div设置为您想要的样式; bot Webchat Github项目提供了几个示例:
侧边栏显示:https://github.com/Microsoft/BotFramework-WebChat/blob/master/samples/sidebar/index.html
对于fullwindow:https://github.com/Microsoft/BotFramework-WebChat/tree/master/samples/fullwindow
我强烈建议你看看第一个样本,它有一个窄,正常和宽div的演示
| 归档时间: |
|
| 查看次数: |
706 次 |
| 最近记录: |