Alexa framework for serverless lambda
npm install serverless-alexa-ability```
npm install serverless-alexa-ability --save
`javascript
import { Ability } from 'serverless-alexa-ability';
exports.index = (event, context, callback) => {
const app = new Ability(event, callback);
app.on('askWeather', () => {
app.say('The weather is 18 degrees and sunny').end();
});
};
`
`javascript`
app.say('hello world').end();
`javascript`
app.ssml('
`javascript`
app.say('Please login').linkAccount().end();
`javascript`
app.say(
'Hello!'
).card({
type: 'Simple',
title: 'Hello',
content: 'World'
}).end();
`javascript
import { Ability } from 'serverless-alexa-ability';
exports.index = (event, context, callback) => {
const app = new Ability(event, callback);
// User says "Do you like cats?"
app.on('likeCats', () => {
app.say('I like cats, do you like cats?').converse();
});
// User says "Yes"
app.on('likeCats/AMAZON.YesIntent', () => {
app.say('Phew thats good, now we can be friends').end();
});
// User says "No"
app.on('likeCats/AMAZON.NoIntent', () => {
app.say('Well this is awkward'.end();
});
};
`
`javascript
app.say(
'The weather is 18 degrees and sunny, is there anything else I can help with?'
).repromptSay(
'Is there anything else I can help with?'
).converse();
app.say(
'The weather is 18 degrees and sunny, is there anything else I can help with?'
).repromptSsml(
'
).converse();
`
`javascript`
app.session({
foo: 'bar',
hello: 'world'
});
`javascript``
const event = app.event();