-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
36 lines (33 loc) · 1.01 KB
/
index.js
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
26
27
28
29
30
31
32
33
34
35
36
'use strict';
const Alexa = require("alexa-sdk");
exports.handler = function(event, context, callback) {
const alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
};
const handlers = {
'LaunchRequest': function () {
this.emit('SayHello');
},
'HelloWorldIntent': function () {
this.emit('SayHello');
},
'SayHello': function () {
this.response.speak('Hello World!');
this.emit(':responseReady');
},
'AMAZON.HelpIntent': function () {
const speechOutput = 'This is the Hello World Sample Skill. ';
const reprompt = 'Say hello, to hear me speak.';
this.response.speak(speechOutput).listen(reprompt);
this.emit(':responseReady');
},
'AMAZON.CancelIntent': function () {
this.response.speak('Goodbye!');
this.emit(':responseReady');
},
'AMAZON.StopIntent': function () {
this.response.speak('See you later!');
this.emit(':responseReady');
}
};