botframework-sdk
botframework-sdk copied to clipboard
Intent and dialog handler Node.JS
I have case where we need common code to handle intent = help and dialog= help.
Now I need to write separate code for dialog and intent
bot.dialog('menu', [ function (session) {....
intents.matches('menu', [ function (session) {
Is there any way that manages both at common function ?
The easiest solution is probably to just invoke the menu dialog from your intent handler:
var intents = new builder.IntentDialog();
bot.dialog('/', intents);
intents.matches(menu, function(session) {
session.beginDialog('menu');
});
bot.dialog('menu', [
function (session, args, next) {
....
},
....
]);
Does that work?
Yes it works for me...