new DefaultResponseManager(providersopt)
Manages responses
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
providers |
Array.Provider |
<optional> |
An array of response providers that will supply responses |
- Implements:
- Source:
Methods
ask(msg, reprompt) → {String}
Helper method to do an ask similar to the alexa api
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | The message to ask to the user |
reprompt |
String | THe reprompt message |
- Implements:
- Source:
Returns:
The rendered string to send back to Alexa
- Type
- String
get(responseId) → {Response}
Returns the specified response by looking through the defined providers.
Optimized to only look once and if not found, will never look through the provider again. This prevents
adding responses to the provider at a later time, but improves repeated lookup performance
Parameters:
Name | Type | Description |
---|---|---|
responseId |
String | The id of the response |
- Implements:
- Source:
Returns:
The response. If not found, returns null
- Type
- Response
render(responseId, valuesMap) → {String}
Helper method that retrieves and renders a response all in one call
Parameters:
Name | Type | Description |
---|---|---|
responseId |
String | The id of the response |
valuesMap |
Object.<String, Object> | The values to use when formatting the response |
Returns:
The rendered string to send back to Alexa
- Type
- String
tell(msg) → {String}
Helper method to do an ask similar to the alexa api
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | The message to tell to the user |
- Implements:
- Source:
Returns:
The rendered string to send back to Alexa
- Type
- String