我想注入channelData与每个消息是从一个僵尸网页控制在一个页面发送。我环顾四周,发现这个示例(https://cmsdk.com/javascript/how-to-send-custom-channel-data-when-using-web-chat-client-with-bot-framework.html),我的代码看起来像下面的代码。发送channelData到网络聊天与每条消息
问题是,这可以在Chrome中运行,但扩展运算符(...)在Edge或IE上不起作用。是否有可用于所有浏览器的替代语法?
var user = {
id: '@User.Identity.Name',
name: '@User.Identity.Name'
};
var bot = {
id: BotId,
name: 'BotName'
};
var botConnect = new BotChat.DirectLine({
secret: '@ViewData["BotSecret"]',
webSockets: 'true'
});
var v = { ...botConnect };
debugger;
BotChat.App({
botConnection: {
...botConnect,
postActivity: activity => {
activity.channelData = {
StudentId: '@User.Identity.Name'
};
return botConnect.postActivity(activity);
}
},
user: user,
bot: bot,
resize: 'detect'
}, document.getElementById("bot"));
边缘应该支持每http://kangax.github.io/compat蔓延-table/es6 /#test-spread _(...)_运营商 –
我认为您需要手动启用实验性功能才能正常工作,并且不希望最终用户必须这样做。我不认为有一个解决方法为IE浏览器。 – GaboG