I have MS bot v4 in node js and configured Facebook and directline channels. everything working fine in Facebook channel but directline channel unable to clear the dialog which is triggered from suggestion actions.
step#1: when I click suggestion action then its action processing very well.
step#2: when I type some utterance (ex: "Hi") bot executing previous dialog which is triggered in step#1.
how can I clear/stop step#1 dialog once it completed.
Please find below code snippet:
below code used to send suggestion action to user.
var msg = MessageFactory.suggestedActions(
CardFactory.actions([
{
type: 'messageBack',
title: 'title',
value: 'XYZDialog'
}
]), 'Click'
);
await stepContext.context.sendActivity(msg);
below code onMessage event to detect the dialog
this.onMessage(async (context, next) => {
if (context._activity.hasOwnProperty('value')) {
this.dialog.initialDialogId = 'XYZDialog';
}
await this.dialog.run(context, this.dialogState);
await next();
});
below code to run above detected dialog.
async run(turnContext, accessor) {
const dialogSet = new DialogSet(accessor);
dialogSet.add(this);
const dialogContext = await dialogSet.createContext(turnContext);
const results = await dialogContext.continueDialog();
if (results.status === DialogTurnStatus.empty) {
await dialogContext.beginDialog(this.id);
}
}
Please let me know how can I resolve this issue. Let me know if you need any additional information.