wait.dsl
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
library
block doWait():doWaitMore {
start node root {
do {
#log("block 'doWait'");
wait*;
}
transitions {
transition1: goto wait_for_abonent_speech on timeout 5000;
}
}
node wait_for_abonent_speech {
do {
#sayText("Вы готовы продолжить?", repeatMode: "ignore");
wait*;
}
transitions {
yes: goto stopwaiting on #messageHasSentiment("positive") || #messageHasIntent("ready");
maybe: goto root on true && !#messageHasSentiment("positive") && !#messageHasIntent("ready") && !#messageHasSentiment("negative");
no: goto waiting on #messageHasSentiment("negative");
}
}
node waiting {
do {
#sayText("Жду.", repeatMode: "ignore");
goto root;
}
transitions{
root: goto root;
}
}
node stopwaiting {
do {
// return value from block
return "yes";
}
}
}
digression wait_for_abonent
{
conditions { on #messageHasAnyIntent(digression.wait_for_abonent.triggers); }
var triggers = ["wait", "waitfor"];
var responses: Phrases[] = ["imwaiting"];
do
{
$cjm.push("wait_for_abonent");
for (var item in digression.wait_for_abonent.responses)
{
#say(item, repeatMode: "ignore");
}
var block_result = blockcall doWait();
if (block_result == "yes")
{
#sayText("Давайте продолжим", repeatMode: "ignore");
#repeat(accuracy:"short");
return;
}
}
transitions
{
}
}