-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathfavoritecolor.js
More file actions
25 lines (22 loc) · 778 Bytes
/
favoritecolor.js
File metadata and controls
25 lines (22 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var chatskills = require('./lib/chatskills');
// Create a new skill.
var favoritecolor = chatskills.add('favoritecolor');
favoritecolor.intent('run', {
"slots": {},
"utterances": ["{to|} {run|start|go|launch}"]
}, function(req, res) {
var prompt = "What is your favorite color?";
res.say(prompt).reprompt(prompt).shouldEndSession(false);
}
);
// Using the Custom Slot Type "ColorType".
favoritecolor.intent('color',{
"slots":{"ColorType":"COLORTYPE"}
,"utterances":["my favorite color is {-|ColorType}",
"{-|ColorType}"]
},
function(req,res) {
res.say("My favorite color is " + req.slot('ColorType') + ' too!');
res.shouldEndSession(true);
}
);