Internet explorer Webchat不适用于Internet Explorer

Internet explorer Webchat不适用于Internet Explorer,internet-explorer,botframework,bots,chatbot,web-chat,Internet Explorer,Botframework,Bots,Chatbot,Web Chat,我和机器人一起工作,现在我正试图通过直达线路实现机器人。 该机器人可以与谷歌浏览器和Mozilla Firefox配合使用,但不能与Internet Explorer配合使用 我得到的唯一错误是语法错误。您可以在本文下面的屏幕截图中看到这一点 但是为什么呢 const store=window.WebChat.createStore({},({dispatch:dispatch})=>next=>action=>{ 如果(action.type==='DIRECT\u LINE/CONNE

我和机器人一起工作,现在我正试图通过直达线路实现机器人。 该机器人可以与谷歌浏览器和Mozilla Firefox配合使用,但不能与Internet Explorer配合使用

我得到的唯一错误是语法错误。您可以在本文下面的屏幕截图中看到这一点

但是为什么呢


const store=window.WebChat.createStore({},({dispatch:dispatch})=>next=>action=>{
如果(action.type==='DIRECT\u LINE/CONNECT\u completed'){
派遣({
键入:“网络聊天/发送事件”,
有效载荷:{
名称:'webchat/join',
值:{language:window.navigator.language}
}
});
}
返回下一步(操作);
});
(异步函数(){
常量标记=“”;
const region=‘西欧’;
const subscriptionKey='';
const webSpeechPonyfillFactory=wait window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
subscriptionKey,
区域
});
常量样式选项={
Botravatarinitials:'BC',
UserAvatariInitials:'UC'
};
window.WebChat.renderWebChat({
directLine:window.WebChat.createDirectLine({token}),
商店,
地区:'de de',
样式选项,
webSpeechPonyfillFactory
},
document.getElementById('webchat');
document.querySelector(“#webchat>*”).focus();
})().catch(err=>console.error(err));
#网络帽{
保证金:0自动;
明确:两者皆有;
填充:0 0px;
位置:固定;
底部:0;
顶部:0px;
垫底:0px;
宽度:100%;
身高:100%;
}

我可以看到您的脚本代码包含=>箭头函数

IE浏览器中不支持

这就是它显示语法错误的原因

您需要将ES6代码转换为ES5代码,以使其在IE浏览器中工作

您可以尝试使用来传输代码

它可以帮助您解决此问题

有用的线程链接:

<pre>
<div id="webchat" role="main"></div>
<script src="https://cdn.botframework.com/botframework-webchat/4.1.0/webchat-es5.js"></script>

<script>
    const store = window.WebChat.createStore({}, ({ dispatch: dispatch }) => next => action => {
        if (action.type === 'DIRECT_LINE/CONNECT_FULFILLED') {
            dispatch({
                type: 'WEB_CHAT/SEND_EVENT',
                payload: {
                    name: 'webchat/join',
                    value: { language: window.navigator.language }
                }
            });
        }
        return next(action);
    });

    (async function () {
        const token =  '<Direct-Line-Secret>';
        const region = 'westeurope';
        const subscriptionKey = '<subscription-key>';

        const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
            subscriptionKey,
            region          
        });

        const styleOptions = {
            botAvatarInitials: 'BC',
            userAvatarInitials: 'UC'
        };

        window.WebChat.renderWebChat({
            directLine: window.WebChat.createDirectLine({ token }),
            store,
            locale: 'de-DE',
            styleOptions,
            webSpeechPonyfillFactory
        },

        document.getElementById('webchat'));
        document.querySelector('#webchat > *').focus();
    })().catch(err => console.error(err));
</script>
    
<style>
    #webchat {
        margin: 0 auto;
        clear: both;
        padding: 0 0px;
        position: fixed;
        bottom: 0;
        top: 0px;
        padding-bottom: 0px;
        width: 100%;
        height: 100%;
    }
</style>
</pre>