timeout
To set a transition to a state if a user doesn’t respond, use the timeout
reply.
tip
You can also use the equivalent
$reactions.timeout
method.Properties
Property | Type | Required | Description |
---|---|---|---|
interval | Number | Yes | Reaction waiting interval in seconds. |
targetState | String | Yes | The state the bot goes to after the timeout expires. |
Syntax
{
"type": "timeout",
"interval": 10,
"targetState": "/timeout"
}
Channel restrictions
timeout
is not supported in the following channels:
- Aimybox
- Alice
- Amazon Alexa
- Google Assistant
- Marusia
- Salut
- The phone channel
- Webim (Custom Channel API)
How to use
state: LeaveFeedback
a: You have recently bought {{$session.item}} from us.
a: Please leave us feedback and let us know how we’re doing!
script:
$response.replies = $response.replies || [];
$response.replies.push({
"type": "timeout",
"interval": 120,
"targetState": "/LeaveFeedback/NoResponse"
});
state: ClientFeedback
q: *
a: Thanks for your feedback!
script:
$analytics.setSessionData("Feedback", $parseTree.text);
state: NoResponse
script:
$analytics.setSessionData("Feedback", "None");