I created a chat bot using the Microsoft Framework. I embedded the chat window into a local website. I want to send and receive events from the embedded web chat. I have found similar questions and tried to implement the techniques explained with no success.
I found this question which is very similar to mine but I could not get the desired outcome when I tried to run the sample code with my own credentials (Webchat Secret, App ID and Password).
Sending events from an embedded webchat
I used the more simple approach of having an index.html
file, botchat.css
and botchat.js
only. (Code here: https://github.com/EricDahlvang/BackChannelEventTest/tree/master/TestStandalone)
The bot appeared on my HTML
page and I could send messages to the bot. But the output from this is supposed to be the background color of the page changing according to the color input to the chat by the user - which was not happening.
There were no errors using Google Chrome
s developer tools. Although when I tried to run the same page in IE
I received a 'Syntax Error' on the line below:
botConnection.activity$
.filter(activity => activity.type === "event" && activity.name === "changeBackground")
The web chat window did not appear when run in IE (only the text and button were visible).
Any help on sending and receiving events from the embedded web chat would be very much appreciated.