botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

bot is not waiting for Prompts.choice input

Open rampratheek opened this issue 10 years ago • 8 comments

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)

rampratheek avatar Nov 03 '16 06:11 rampratheek

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?

Stevenic avatar Nov 03 '16 21:11 Stevenic

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.

rampratheek avatar Nov 04 '16 01:11 rampratheek

+1

ritazh avatar Nov 10 '16 02:11 ritazh

@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?

Stevenic avatar Nov 13 '16 23:11 Stevenic

@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.

bearnshaw avatar Nov 22 '16 20:11 bearnshaw

Closing due to lack of response. If you are still having the issue, please reopen and we will look into it more.

chrimc62 avatar Nov 27 '16 23:11 chrimc62

I am facing the same issue. :(

janhim89 avatar Oct 11 '17 07:10 janhim89

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.

Zelophobian avatar Oct 11 '17 16:10 Zelophobian