dialog test
This commit is contained in:
@@ -19,16 +19,16 @@ module.exports = {
|
||||
init: function (express) {
|
||||
alexaApp.express ({
|
||||
expressApp: express,
|
||||
|
||||
|
||||
// verifies requests come from amazon alexa. Must be enabled for production.
|
||||
// You can disable this if you're running a dev environment and want to POST
|
||||
// things to test behavior. enabled by default.
|
||||
checkCert: false,
|
||||
|
||||
|
||||
// sets up a GET route when set to true. This is handy for testing in
|
||||
// development, but not recommended for production. disabled by default
|
||||
debug: true,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
updateIntentsJSON: function () {
|
||||
@@ -42,7 +42,7 @@ module.exports = {
|
||||
slots: [],
|
||||
utterances: intent.questions,
|
||||
},
|
||||
function (request, response) {
|
||||
(request, response) => {
|
||||
return response.say (intent.answer).shouldEndSession (false);
|
||||
}
|
||||
);
|
||||
@@ -52,6 +52,38 @@ module.exports = {
|
||||
return response.say (skill.invocationAnswer).shouldEndSession (false);
|
||||
});
|
||||
|
||||
alexaApp.intent (
|
||||
'EmailIntent',
|
||||
{
|
||||
dialog: {
|
||||
type: 'delegate',
|
||||
},
|
||||
slots: [
|
||||
{
|
||||
name: 'Name',
|
||||
type: 'AMAZON.US_FIRST_NAME',
|
||||
samples: [],
|
||||
},
|
||||
{
|
||||
name: 'Color',
|
||||
type: 'AMAZON.Color',
|
||||
samples:[]
|
||||
},
|
||||
],
|
||||
utterances: [
|
||||
'I would like to send a message',
|
||||
'I want to send a message',
|
||||
'Send message',
|
||||
],
|
||||
},
|
||||
(request, response) => {
|
||||
console.log ('Completed : ' + request.getDialog.isCompleted ());
|
||||
console.log('Name : ' + request.slot('Name'));
|
||||
console.log('Color : ' + request.slot('Color'));
|
||||
}
|
||||
);
|
||||
|
||||
/*
|
||||
alexaApp.intent (
|
||||
'EmailIntentLaunch',
|
||||
{
|
||||
@@ -193,6 +225,7 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
);
|
||||
*/
|
||||
})
|
||||
.catch (err => {
|
||||
console.log (err);
|
||||
|
||||
Reference in New Issue
Block a user