Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function (context, req) {
- context.log('Call: ' + JSON.stringify(req));
- let action = req.body.request.intent.slots.action ?
- req.body.request.intent.slots.action.value : 'Unknown';
- let device = req.body.request.intent.slots.device ?
- req.body.request.intent.slots.device.value : 'Unknown';
- let message = 'Action is ' + action + ' and device is ' + device;
- let response = {
- "version": "string",
- "sessionAttributes": {
- "key": "value"
- },
- "response": {
- "outputSpeech": {
- "type": "PlainText",
- "text": message
- },
- "card": {
- "type": "Standard",
- "title": "Test",
- "content": "This is just a simple card",
- "text": "Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb.",
- "image": {
- "smallImageUrl": "https://s3.amazonaws.com/imgserv.ownlocal.com/pets-and-animals/pet-care/pet-care01-640x480%3E.jpg",
- "largeImageUrl": "https://metrouk2.files.wordpress.com/2017/03/pets-e1490696661315.jpg"
- }
- },
- "shouldEndSession": true
- }
- };
- context.res = {
- status: 200,
- body: response
- };
- context.done();
- };
Add Comment
Please, Sign In to add comment