I'm using conversationUpdate() to have my bot automatically greet the user once the web page loads with my chatbot. It then starts up the root dialog with a menu of choices. See code snippet below.
The problem is that once the user joins the conversation, the / dialog is automatically called again, and the user is seeing a repeated dialog of menu choices.
How do I stop the root dialog from starting once the user joins the conversation? If I can't, how can I work around this problem?
My idea was to force add the user to the conversation at the same time as bot. Not sure if that makes sense.
First bot here, so not sure how to do this.
bot.on('conversationUpdate', function(activity) {
if (activity.membersAdded) {
const hello = new builder.Message()
.address(activity.address)
.text("Welcome....");
activity.membersAdded.forEach(function(identity) { // say hello only when bot joins and not when user joins
if (identity.id === activity.address.bot.id) {
bot.send(hello);
bot.beginDialog(activity.address, '*:/');
}
});
}
});