servant-cli
Version:
Command line tool for building Commands with Servant (http://www.getservant.com)
43 lines (30 loc) • 1 kB
JavaScript
module.exports = function(Extension) {
/**
* Command Template: Simple
*/
return function() {
var dialogs = {
// Greet
d_a1: function(d) {
var response_dialog = {
dialog: d ? d : '<p>Ok, Master. What can I help you with?</p>',
data: Extension.Event.data,
options: [{
key: 'this',
value: '<p>I will do "this" for you.</p>'
}, {
key: 'that',
value: '<p>I will do "that" for you.</p>'
}],
next_dialog_id: 'd_a2'
};
return Extension.Callback(null, response_dialog);
}
};
/**
* Route Dialog
*/
if (dialogs[Extension.Event.dialog_id]) return dialogs[Extension.Event.dialog_id]();
else return dialogs.d_a1();
};
};