Skip to content

Commit

Permalink
Bump README and CHANGELOG for new Dialogue logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott BonAmi committed Jun 22, 2017
1 parent c47e9ca commit d8d56fd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 4.0.2 (Next)
* [#97](https://github.com/alexa-js/alexa-app/pull/97): Added support for custom directives - [@ajcrites](https://github.com/ajcrites).
* [#248](https://github.com/alexa-js/alexa-app/pull/248): Add support for intent and slot `confirmationStatus` - [@sbonami]((https://github.com/sbonami).
* [#249](https://github.com/alexa-js/alexa-app/pull/249): Add support for handling and/or delegating Dialogue - [@sbonami]((https://github.com/sbonami).
* Your contribution here

### 4.0.1 (May 17, 2017)
Expand Down
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* [Generating Schema and Utterances Output](#generating-schema-and-utterances-output)
* [Cards](#cards)
* [Card Examples](#card-examples)
* [Custom Directives](#custom-directives)
* [Dialogue](#dialogue)
* [Error Handling](#error-handling)
* [Asynchronous Handlers Example](#asynchronous-handlers-example)
* [Customizing Default Error Messages](#customizing-default-error-messages)
Expand Down Expand Up @@ -167,6 +169,9 @@ String request.confirmationStatus
// check if the intent is confirmed
Boolean request.isConfirmed()

// return the Dialogue object
Dialogue request.getDialogue()

// check if you can use session (read or write)
Boolean request.hasSession()

Expand Down Expand Up @@ -640,6 +645,43 @@ The `alexa-app` library has special handling for AudioPlayer directives, so you

The `response.directive` adds your directive object to the directives array in the response. To clear the directives from the response, call `response.getDirectives().clear()`.

## Dialogue

The `alexa-app` library has special handling for enabling Alexa to handle Dialogue directly. To
configure `alexa-app` to delegate dialogue to Alexa, enable the handling
per-intent via the schema:

```javascript
app.intent("sampleIntent", {
"dialogue": {
type: "delegate"
},
"slots": { ... },
"utterances": [ ... ],
},
function(request, response) { ... }
);
```

### dialogue object

```javascript
// return the Dialogue object
Dialogue request.getDialogue()

// return the intent's dialogueState
String request.dialogueState

// check if the intent's dialogue is STARTED
Boolean dialogue.isStarted()

// check if the intent's dialogue is IN_PROGRESS
Boolean dialogue.isInProgress()

// check if the intent's dialogue is COMPLETED
Boolean dialogue.isCompleted()
```

## Error Handling

When handler functions throw exceptions, they will trigger a rejection in the promise chain. If the response has not already been sent, `.post` will be triggered which will allow you to force a successful response. If `post` does not alter the response, then a failed response will be sent. You can use this to throw an exception to or call `return response.fail("message")` to force a failure, but this *does not* generate a response compatible with Alexa.
Expand Down

0 comments on commit d8d56fd

Please sign in to comment.