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

To help you get started, we’ve selected a few ask-sdk-core 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 alexa / alexa-cookbook / feature-demos / skill-demo-display-directive / lambda / custom / index.js View on Github external
getSmallImage(selectedState.Abbreviation),
      getLargeImage(selectedState.Abbreviation),
    );

    speechOutput = getSpeechDescription(selectedState);

    if (supportsDisplay(handlerInput)) {
      const image = new Alexa.ImageHelper()
        .addImageInstance(getLargeImage(selectedState.Abbreviation))
        .getImage();
      const bgImage = new Alexa.ImageHelper()
        .addImageInstance(getBackgroundImage(800, 1200, selectedState.Abbreviation))
        .getImage();
      const title = getCardTitle(selectedState);
      const bodyTemplate = bodyTemplateChoice(getCardTitle(selectedState));
      const primaryText = new Alexa.RichTextContentHelper()
        .withPrimaryText(getTextDescription(selectedState, '<br>'))
        .getTextContent();
      responseBuilder.addRenderTemplateDirective({
        type: bodyTemplate,
        backButton: 'visible',
        backgroundImage: bgImage,
        image,
        title,
        textContent: primaryText,
      });
      speechOutput = `This is the ${getBodyTemplateName(bodyTemplate)} template, also known as body template number ${getBodyTemplateNumber(bodyTemplate)}. `;
    }


    return responseBuilder.speak(speechOutput + repromptOutput)
      .reprompt(repromptOutput)