bot is not waiting for Prompts.choice input
Ran the following code and the prompt was not waiting for the client's selection of choice.
bot.dialog('/Choices',[
function(session){
session.send("Please select one of the following Choices")
builder.Prompts.choice(session," ","Choice1|Choice2|Choice3");
},
function(session,results){
console.log("Prompt Response")
session.beginDialog("/"+results.response.entity);
}
])`
Bot was taking the " undefined " as the choice and giving the following Error
Error: Dialog[*:/undefined] not found. at Session.beginDialog (/home/user/node_modules/botbuilder/lib/Session.js:134:19) at Array.<anonymous> (/home/user/workspace/XCubeLabsBOT/BOT2.js:141:35) at SimpleDialog.waterfallAction [as fn] (/home/user/node_modules/botbuilder/lib/dialogs/DialogAction.js:116:32) at SimpleDialog.dialogResumed (/home/user/node_modules/botbuilder/lib/dialogs/SimpleDialog.js:20:14) at Session.endDialog (/home/user/node_modules/botbuilder/lib/Session.js:214:28) at Array.<anonymous> (/home/user/workspace/XCubeLabsBOT/BOT2.js:65:33) at SimpleDialog.waterfallAction [as fn] (/home/user/node_modules/botbuilder/lib/dialogs/DialogAction.js:116:32) at SimpleDialog.dialogResumed (/home/user/node_modules/botbuilder/lib/dialogs/SimpleDialog.js:20:14 at Session.endDialogWithResult (/home/user/node_modules/botbuilder/lib/Session.js:237:28) at SimpleDialog.waterfallAction [as fn] (/home/user/node_modules/botbuilder/lib/dialogs/DialogAction.js:123:19)
does is just get back 'undefined' as the choice? Or does it call the next waterfall step before the user even types anything? I see nothing wrong with this code at first blush. Is this the actual code or a simplified version?
It is also the actual code. the bot calls the next waterfall step before the user types anything and takes undefined as the choice.Thus the " /undefined " not found is coming in my error log.
i was also getting default_error for every query when hosted on any other machine.
+1
@rampratheek I tried the exact code above and couldn't get the issue to reproduce with either the ChatConnector or ConsoleConnector classes. What version of the SDK are you using?
@rampratheek not sure if this applies in your case, but if you pass arguments containing the key "resumed" to a waterfall step, that step will be ignored and execution will be passed to the next step.
Closing due to lack of response. If you are still having the issue, please reopen and we will look into it more.
I am facing the same issue. :(
As I recall it, the problem was the missing if Statement in the followed function after the choise to check if a results.response was given or not. I think that fixed it.