參考
https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-dialog-overview
allow you to model conversations and manage conversation
也就是說 所有的 對話腳本邏輯 都是由此決定
var builder = require('botbuilder');
var connector = new builder.ConsoleConnector().listen();
var bot = new builder.UniversalBot(connector, function (session) {
session.send("you:"+s.message.text)
});
註 在3.5以前,是寫成這樣
var bot = new builder.UniversalBot(connector);
bot.dialog(“/", s => {
s.send("you:"+s.message.text)
})
但目前還是可以這樣寫
dialog裡定義waterfalls
waterfalls的表現方式,
就是照排序的 array ,
然後照這
waterfalls
// Ask the user for their name and greet them by name.
bot.dialog('greetings', [
function (session) {
builder.Prompts.text(session, 'Hi! What is your name?');
},
function (session, results) {
session.endDialog(`Hello ${results.response}!`);
}
]);
順序做為對話順序的安排