ページ内のbot Webchatコントロールから送信された各メッセージをchannelDataに挿入しようとしています。私は周りを見回し、このサンプル(https://cmsdk.com/javascript/how-to-send-custom-channel-data-when-using-web-chat-client-with-bot-framework.html)と私のコードは、以下のコードのように見えます。各メッセージでwebchatに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 _(...)_ operator –
実験的な機能を手動で有効にする必要があると思うし、エンドユーザーにそれをさせたくないと思う。 IEの回避策はないと思います。 – GaboG