When I enter the "reset" command, I want the conversation restart again and clear all the previous dialog, May I ask about how to do it? I had stuck for 2 days. Thank in advanced.
Here with my source code.
bot.dialog('/reset', (session) => {
session.endDialog();
var msg = new builder.Message(session)
.addAttachment(welcomecard_1.welcomeCard());
session.send(msg);
})
.triggerAction({
matches: /^reset$/i
});
After I enter the "reset" or "/reset"
the previous conversation [in red color] will remove from the dialog and this channel is using direct line.
Updated: I had try this code , but not work.
bot.use(builder.Middleware.dialogVersion({ version: 1.0, resetCommand: /^reset/i }));
You can clear the dialog stack using session.clearDialogStack()
or session.endConversation()
or session.reset()
. Here are the differences between them:
session.clearDialogStack()
session.endConversation()
conversationData
and privateConversationData
endOfConversation
event to the channelsession.reset()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With