-
-
Save yosun/9eead64257f709217d18ddd3f2a62602 to your computer and use it in GitHub Desktop.
test alexa echo show background image bodytemplate6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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