My question is simple as I done in SDK v3.
I would like to send message to user after 2 min of his idle with bot. Hence I have used setTimeOut() to send message. if user enters any message with in 2 min then I need to clear above setTimeOut using clearTimeOut();
in v#4, Dialogcontext not working within the setTimeOut() and when I print the value of Dialogcontext is "undefined".
Please find below code snippet in v4.
const results = await dialogContext.continueDialog();
console.log('---active dialog status....',results);
if( dialogContext.context._activity.value===engconstant.getstarted){
if (results.status === DialogTurnStatus.empty) {
console.log('before timeinterval starts');
await getstartedinterval(dialogContext);
}
}
below code shows getStartedinterval function.
async function getstartedinterval(dialogContext)
{
timeoutobj= setTimeout(function (dialogContext) {
console.log('--- inside setTimeout----',dialogContext);// displaying as undefined
notificationMsgGetStarted(dialogContext);
},constant.timeinterval);
}
How can I resolve this?