Prompts.confirm is not working after the call session.send.
Hello team,
I have a scenario like showing some offer about some product and asking confirmation from the user, and hence I tried below code in node.js:
var captionText = "We have found a perfect offer for you. Please check this.\n";
var reply = new builder.Message()
.setText(session, captionText)
.addAttachment({
text: "
});
session.send(reply); builder.Prompts.confirm(session, "Do you like to proceed " + session.userData.name + "?\nPlease confirm." );
Please correct me, if I am wrong.
Thanks and Regards, Giri G.
Is it just not working in the emulator? For multi-send to work with the emulator you need to manually adjust the endpoint replies are sent to. See examples/TestBot/BotConnectorBot.js for an example of doing this. This should all go away in our next update.
Hello Steve, Thanks for your swift response. And the issue I faced here is: In emulator, I could not see the Prompt after session. send. and In web chat, It comes only once...it is not consistent. Let me go through for the emulator as per your reference.
And with respect to webchat, any direction you suggest. And here is my bot id:VZChatBotApp for you to debug, in case, if you got access.
Regards, Giri G.
I didn't see any issue with your code so not sure why WebChat wouldn't be working.
I have uploaded with screen shot.
when I showed one offer first time, it is asking the confirmation. However, when I showed the another offer, the confirmation is not asked (check the image on the right side).
Regards, Giri G.
another issue is, the titleLink attribute for the attachment is not coming in webchat. Please take a look Steve.
Hello Steve, did you get a chance to debug these issue?
My guess is that userData.selectedOffer is null after the first offer. You might try verifying that you in fact have a link (pass it as part of the text)
No it is not. Basically the confirmation dialog is not behaving consistently...Please take a look.
Oh I see... the second call to confirm is getting dropped. That's interesting. Is it always the case that only the first one comes through? Could you do me a favor and try adding session.send("test text"); before the call to Prompts.confirm(). This would help me figure out if the issue is in the webchat control as this doesn't reproduce for me using the emulator.
Also to get multiple prompts working in the emulator you'll need to temporarily add bot.configure({ endpoint: 'http://localhost:9000' }); which tells the bot to send the additional prompts to the emulator. There's a fix for this coming that removes the need to do this.
I just published v0.10.0 which fixes the emulator issues. Please update and give the emulator another try.
Sure. Thanks, I will take a look for emultator. Currently I am testing it on web chat, where we noticed the above issues. Would appreciate, if you could make it happen (allowing Prompts. confirm() after session.send() call) in webchat context.
Regards, Giri G.
It could be that the WebChat control is acting up. I need to narrow down that this is something specific to the WebChat control as that's a completely different team. That's why I keep asking if it works elsewhere.
Could you try v0.11.0 and let me know if you're still having issues. I fixed a number of things around prompts.
Sure...will get back to you.
Regards, Giri G.
Where does this issue stand?
Hello Steve, Sorry for the belated response... I could see only botbuilder 0.9.2, when I try to lookup the module from "install new npm packages" in Visual Studion 2015. Can u please tell be where I could download it?
if that is the latest code, then i can say the issue still exists. Could you please respond. Thanks.
The latest version is 1.0.1
Hello Steve,
I tried this basic code, but it is failing still. The Prompts are not appearing after the send. This is happening in emulator and web chat.
function (session) {
// Send a greeting and start the menu.
session.send("Message 1");
builder.Prompts.confirm(session, "Do you like to proceed?");
},
function (session, results) {
if (results.response) {
// Always say goodbye
session.send(results.response);
}
else {
// Always say goodbye
session.send("Ok... See you later!");
}
}
I am using the [email protected]. version only. Appreciate your response.
Regards, Giri G.
Closing this issue due to age. @giriganapathy - please open a new issue if this issue is not fixed and needs further discussion. @Stevenic - reopen if necessary. Thanks!