Botframework-sdk: NodeJS - Is it possible to let the chat connector programmatically receive a message?

Created on 30 Jan 2017  路  7Comments  路  Source: microsoft/botframework-sdk

At the end of my last dialog i want to use the last user input as an input for my main dialog.

session.endDialogWithResult({ response: session.message });

Iam able to get the lase user message in the first step of my " \ " root dialog. Now i want to start a dialog based on the last user input. So is it possible to start a dialog with a specific input message?

Currently i need to type in the message again to properly manage the transition between the end of the last dialog and a "new" start of the root dialog.

Most helpful comment

Hi @Lugo239, it looks like this thread is solved, right? I'm closing this, but feel free to reopen or open a new issue if you still need help. Thanks!

All 7 comments

Have you tried starting the dialog you want with beginDialog() passing in the conversation via args.

for example, in your last handler, you could have

session.beginDialog('/', { message: session.message });
session.endDialog();

and then check in your dialog handler for /

if (args.message) {
// The result of the last conversation
}

Hey bondz!

Thanks for your fast and helpful reply! It is working correctly.
At this point the last message can be used as an input for the first dialog of the root.

Thanks a lot!

@Lugo239 happy to help 馃槃

Hey its me again.

I have a follow up problem related to the way my main root is looping at this moment.

Iam enable to use the last message as input for the listen dialog. But now the builder.Prompts methods does not wait for user input anymore. Did smb of you got a similar problem?

If you were implementing the loop in the same dialog, you might want to take a look at the loop example using replaceDialog @Lugo239, how do you mean, the prompt doesn't wait for user input?

Hi @Lugo239, it looks like this thread is solved, right? I'm closing this, but feel free to reopen or open a new issue if you still need help. Thanks!

Hey Guys!

Yes problem solved. Thanks to all of you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akakoychenko picture akakoychenko  路  3Comments

hailiang-wang picture hailiang-wang  路  3Comments

vaditya04 picture vaditya04  路  3Comments

clearab picture clearab  路  3Comments

sebsylvester picture sebsylvester  路  3Comments