Skip to content

Instantly share code, notes, and snippets.

@yosun

yosun/index.js Secret

Last active January 8, 2018 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yosun/9eead64257f709217d18ddd3f2a62602 to your computer and use it in GitHub Desktop.
Save yosun/9eead64257f709217d18ddd3f2a62602 to your computer and use it in GitHub Desktop.
test alexa echo show background image bodytemplate6
const Alexa = require('alexa-sdk');
// utility methods for creating Image and TextField objects
const makePlainText = Alexa.utils.TextUtils.makePlainText;
const makeImage = Alexa.utils.ImageUtils.makeImage;
// ...
const handlers = {
'LaunchRequest' : function() {
const speechOutput = 'Hello world!';
const repromptSpeech = 'Hello again!';
const cardTitle = 'Hello World Card';
const cardContent = 'This text will be displayed in the companion app card.';
const imageObj = {
smallImageUrl: 'https://imgs.xkcd.com/comics/standards.png',
largeImageUrl: 'https://imgs.xkcd.com/comics/standards.png'
};
this.response.speak(speechOutput)
.listen(repromptSpeech)
.cardRenderer(cardTitle, cardContent, imageObj);
this.emit(':responseReady');
}
}
exports.handler = function(event, context, callback) {
const alexa = Alexa.handler(event, context, callback);
alexa.registerHandlers(handlers);
alexa.execute();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment