Skip to content

Instantly share code, notes, and snippets.

@jazzedge
Last active August 12, 2017 17:41
Show Gist options
  • Select an option

  • Save jazzedge/39e3271ce16c2084855efd5e9ae5c39f to your computer and use it in GitHub Desktop.

Select an option

Save jazzedge/39e3271ce16c2084855efd5e9ae5c39f to your computer and use it in GitHub Desktop.
Bot - onSelectAction: trigger new dialog without clearing stack
bot.dialog('help', function (session, args, next) {
session.endDialog("I'm a virtual assistant that can help decide whether or not you require planning permission for a loft. <br/>Please say 'ok' to continue");
})
.triggerAction({
matches: /^help$/i,
onSelectAction: (session, args, next) => {
// Add the help dialog to the dialog stack
// (override the default behavior of replacing the stack)
session.beginDialog(args.action, args);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment