jazzedge
7/10/2017 - 8:11 AM

Bot endConversation and reset all data

Bot endConversation and reset all data

//End Conversation and clear all data (restart the conversation completely)
bot.dialog('reset', function (session) {
    session.dialogData = {};
    session.userData = {};
    session.conversationData = {};
    session.privateConversationData = {};
    session.endConversation("End Conversation");
}).triggerAction({ matches: /^(exit)|(quit)|(goodbye)|(finish)|(stop)|(end)|(terminate)/i });