I'm used to v3 node botbuilder sdk so I have a middleware where I look at the dialog stack and do operation I needed as follows.
V3 middleware which knows dialog stack:-
bot.use({
botbuilder: function (session, next) {
if (session.dialogStack()&& session.dialogStack().length <= 0 ) {
// Do something is dialog stack is empty.
}
},
send: function (event, next) {
if (event.type != "typing" && event.type != "endOfConversation") {
logUserConversation("Botoutput", event);
}
next();
}
});
V4 middleware where I need to use dialog stack to perform some operations.
adapter.use(async (turnContext, next) => {
// pre-processing of the current incoming activity
turnContext.onSendActivities(async (sendContext, activities, nextSend) => {
// console.log(`pre-processing of outgoing activities`);
await nextSend();
***//Need to know the dialog stack here.***
});
await next();
});
I looked up on turnContext object but there is no indication if dialog stack. I can see DialogContext object has a 'stack' property but, not sure how to use in my middleware.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)