-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndex.js
More file actions
59 lines (53 loc) · 1.32 KB
/
Index.js
File metadata and controls
59 lines (53 loc) · 1.32 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const Alexa = require('alexa-sdk')
const exerStart = `
<emphasis level ="moderate">Start</emphasis>
<break time='10s'/>
<break time='10s'/>
<break time='10s'/>
<break time='10s'/>
Ten seconds left.
<break time='10s'/>
<emphasis level ="moderate">Thats time</emphasis>
`;
const Sets = `
<break time='10s'/>
<break time='10s'/>
<break time='9s'/>
Ready
<break time='500ms'/>
${exerStart}
Rest
`;
const speech = `
Hello there, before we begin your seven minute training session I will give you a few seconds to get ready.
<break time='5s'/>
Okay lets go and remember to try and put as <emphasis level ="moderate">much</emphasis> effort into it as possible keep breathing and keep yourself moving.
<break time='500ms'/>
${exerStart}
Thats one session done now rest for thirty seconds.
${Sets}
${Sets}
${Sets}
${Sets}
${Sets}
Ready
<break time='10s'/>
<break time='10s'/>
<break time='10s'/>
${exerStart}
Great work you have completed your session.
I hope you had a good one.
`
const handlers = {
StartSession: function() {
this.emit(':tell', speech)
},
LaunchRequest: function() {
this.emit('StartSession')
},
}
exports.handler = (event, context, callback) => {
const alexa = Alexa.handler(event, context, callback)
alexa.registerHandlers(handlers)
alexa.execute()
}