You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
session.endDialog("Global commands that are available anytime:\n\n* menu - Exits a demo and returns to the menu.\n* goodbye - End this conversation.\n* help - Displays these commands.");
171
+
}
155
172
]);
156
173
157
174
bot.dialog('/prompts',[
@@ -160,65 +177,37 @@ bot.dialog('/prompts', [
160
177
builder.Prompts.text(session,"Prompts.text()\n\nEnter some text and I'll say it back.");
session.send("Bot Builder includes a rich choice() prompt that lets you offer a user a list choices to pick from. On Facebook these choices by default surface using buttons if there are 3 or less choices. If there are more than 3 choices a numbered list will be used but you can specify the exact type of list to show using the ListStyle property.");
174
-
builder.Prompts.choice(session,"Prompts.choice()\n\nChoose a list style (the default is auto.)","auto|inline|list|button|none");
session.send("Bot Builder includes a rich choice() prompt that lets you offer a user a list choices to pick from. On Facebook these choices by default surface using buttons if there are 3 or less choices. If there are more than 3 choices a numbered list will be used but you can specify the exact type of list to show using the ListStyle property.");
186
+
builder.Prompts.choice(session,"Prompts.choice()\n\nChoose a list style (the default is auto.)","auto|inline|list|button|none");
builder.Prompts.time(session,"Prompts.time()\n\nThe framework can recognize a range of times expressed as natural language. Enter a time like 'Monday at 7am' and I'll show you the JSON we return.");
builder.Prompts.time(session,"Prompts.time()\n\nThe framework can recognize a range of times expressed as natural language. Enter a time like 'Monday at 7am' and I'll show you the JSON we return.");
builder.Prompts.attachment(session,"Prompts.attachment()\n\nYour bot can wait on the user to upload an image or video. Send me an image and I'll send it back to you.");
builder.Prompts.attachment(session,"Prompts.attachment()\n\nYour bot can wait on the user to upload an image or video. Send me an image and I'll send it back to you.");
session.send("Bots can register global actions, like the 'help' & 'goodbye' actions, that can respond to user input at any time. You can even bind actions to buttons on a card.");
415
+
416
+
varmsg=newbuilder.Message(session)
417
+
.textFormat(builder.TextFormat.xml)
418
+
.attachments([
419
+
newbuilder.HeroCard(session)
420
+
.title("Hero Card")
421
+
.subtitle("Space Needle")
422
+
.text("The <b>Space Needle</b> is an observation tower in Seattle, Washington, a landmark of the Pacific Northwest, and an icon of Seattle.")
session.endDialog("The 'Current Weather' button on the card above can be pressed at any time regardless of where the user is in the conversation with the bot. The bot can even show the weather after the conversation has ended.");
433
+
}
434
+
]);
435
+
436
+
// Create a dialog and bind it to a global action
437
+
bot.dialog('/weather',[
438
+
function(session,args){
439
+
session.endDialog("The weather in %s is 71 degrees and raining.",args.data);
440
+
}
441
+
]);
442
+
bot.beginDialogAction('weather','/weather');// <-- no 'matches' option means this can only be triggered by a button.
0 commit comments