Skip to main content

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 timeout tag or the $reactions.timeout method.

Properties

PropertyTypeRequiredDescription
intervalNumberYesReaction waiting interval in seconds.
targetStateStringYesThe 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:

  • The phone channel

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");