I've deployed a bot written in nodejs using backchannel. In my BOT, I am creating event as follows
creating event in a bot.dialog:
var ev = createEvent('sendUserInfo', "test", session.message.address);
session.endDialog(ev)
event function
const createEvent = (eventName, value, address) => {
var msg = new builder.Message().address(address);
msg.data.type = 'event';
msg.data.name = eventName;
msg.data.value = value;
return msg;}
In web chat javascript, I am trying to subscribe for this event, but NOT getting any response.
botConnection.activity$
.filter(activity => activity.type === "event")
.subscribe(activity => console.log(activity));
Same subscription is working properly if I create postActivity from web chat directly.
botConnection
.postActivity({ type: "event", name: "sendUserInfo", value: "test", from: user })
.subscribe(id => console.log("success", id));
Any suggestion, why I am not able to catch events created from BOT in web chat ?
Other way is working fine, if I create event from web chat and subscribe for event in BOT it working as expected.
bot.on("event", function (event) {
var msg = new builder.Message().address(event.address);
msg.data.textLocale = "en-us";
bot.send(msg);
})
