botpress
Version:
The world's first CMS for bots. Easily create, manage and extend chatbots.
88 lines (87 loc) • 2 kB
JSON
{
"version": "0.1",
"catchAll": {
"onReceive": [],
"next": [
{
"condition": "event.nlu.intent.is('forget')",
"node": "forget-my-name"
}
]
},
"startNode": "entry",
"nodes": [
{
"id": "bda0320009",
"name": "welcome",
"onEnter": ["say #!builtin_text-pSsHWg", "getTotalNumberOfConversations {}"],
"onReceive": null,
"next": [
{
"condition": "state.$r === 0",
"node": "first-time"
},
{
"condition": "state.$r > 0",
"node": "many-times"
}
]
},
{
"id": "7099199f90",
"name": "first-time",
"next": [],
"onEnter": ["say #!builtin_text-AY5SSW", "say #!builtin_text-X069Le"],
"onReceive": null
},
{
"id": "c69ee2d71f",
"name": "many-times",
"next": [],
"onEnter": ["say #!builtin_text-bFsOmf"],
"onReceive": null
},
{
"id": "4f50a2e9fd",
"name": "forget-my-name",
"next": [],
"onEnter": [
"say #!builtin_text-TtzrCV",
"resetUserVariable {\"name\":\"nickname\"}",
"say #!builtin_text-kKQ8C3"
],
"onReceive": null
},
{
"id": "a54a82eb7c",
"name": "entry",
"onEnter": ["getUserVariable {\"name\":\"nickname\",\"output\":\"$r\"}"],
"onReceive": null,
"next": [
{
"condition": "state.$r !== null",
"node": "welcome"
},
{
"condition": "true",
"node": "ask-name"
}
]
},
{
"id": "d29fc6b771",
"name": "ask-name",
"next": [
{
"condition": "true",
"node": "welcome"
}
],
"onEnter": ["say #!builtin_text-z0J9qh"],
"onReceive": [
"setUserVariable {\"name\":\"nickname\",\"value\":\"{{event.text}}\",\"expiry\":\"never\"}",
"getUserVariable {\"name\":\"nickname\",\"output\":\"$r\"}"
]
}
]
}