Util/MessageModel

The messageModelUtil is a set of utility functions to help deriving string or speech representation of a CMM (Conversation Message Model) message. This is used primarily to output text or speech to voice and text-based channels like Alexa and SMS.
Source:

Methods

(static) cardToText(card, cardPrefixopt) → {string}

Source:
utility function to derive a string representation of a card within a conversation message for use with speech or text based channels like Alexa and SMS.
Parameters:
Name Type Attributes Description
card object A card (as defined in Conversation Message Model)
cardPrefix string <optional>
A string prefix used before the card content, for example 'Card'
Returns:
A string or speech representation of the card.
Type
string

(static) convertRespToText(convMsg) → {string}

Source:
utility function to derive a string representation of a Conversation Message for use with speech or text based channels like Alexa and SMS.
Parameters:
Name Type Description
convMsg object A message conforming to Conversation Message Model.
Returns:
A string or speech representation of the conversation message.
Type
string