How to use the ask-sdk.RichTextContentHelper function in ask-sdk

To help you get started, we’ve selected a few ask-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robm26 / travel-browser / lambda / custom / index.js View on Github external
const description = data.getDescription(city);
        say += description || ``;

        const img = data.getImgUrl(city);

        if (helpers.supportsDisplay(handlerInput)) {

            const myImage1 = new Alexa.ImageHelper()
                .addImageInstance(img)
                .getImage();

            const myImage2 = new Alexa.ImageHelper()
                .addImageInstance(img)
                .getImage();

            const primaryText = new Alexa.RichTextContentHelper()
                .withPrimaryText(`Here is ${city}!`)
                .getTextContent();

            responseBuilder.addRenderTemplateDirective({
                              type: 'BodyTemplate6',
                              token: 'string',
                              backButton: 'HIDDEN',
                              backgroundImage: myImage2,
                              image: myImage1,
                              title: helpers.capitalize(invocationName),
                              textContent: primaryText
                        });

        }

        return handlerInput.responseBuilder
github robm26 / travel-browser / lambda / index / index.js View on Github external
const responseBuilder = handlerInput.responseBuilder;

        const DisplayImg1 = constants.getDisplayImg1();
        const DisplayImg2 = constants.getDisplayImg2();

        if (helpers.supportsDisplay(handlerInput)) {
            const myImage1 = new Alexa.ImageHelper()
                .addImageInstance(DisplayImg1.url)
                .getImage();

            const myImage2 = new Alexa.ImageHelper()
                .addImageInstance(DisplayImg2.url)
                .getImage();

            const primaryText = new Alexa.RichTextContentHelper()
                .withPrimaryText('Welcome to the skill!')
                .getTextContent();

            responseBuilder.addRenderTemplateDirective({
                type : 'BodyTemplate2',
                token : 'string',
                backButton : 'HIDDEN',
                backgroundImage: myImage2,
                image: myImage1,
                title: helpers.capitalize(invocationName),
                textContent: primaryText,
            });
        }
        const welcomeCardImg = constants.getWelcomeCardImg();

        return handlerInput.responseBuilder

ask-sdk

Standard distribution package for Alexa Skills Kit SDK

Apache-2.0
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis