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 $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:

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