{
"text": "Could be line here"
}
{
"text": "Could be variable here {{$user.value}}"
}
{
"text": ["Could be", "Few lines"]
}
{
"text": {
"ru": "...",
"en": "...",
"ua": "...",
"langVar": "$user.lang"
}
}
langVar stores the name of varible where to get the current language
$user.lang = "en";
console.log($user.lang); //=> en
{
"images": "https://.....com/image.png"
}
{
"images": ["https://.....com/image.png", "https://.....com/image2.png"]
}
{
"buttons": {
"hello": "goto:another-step1",
"world": "goto:another-step2"
}
}
{
"buttons": {
"hello": {
"store": "$user.action = 'hello'",
"goto": "another-step"
}
}
}
Use Livescript syntax inside store
Available variables: $user
,$global
{
"buttons": {
"button" : {
"ru": {"buttonRUtext": { "goto" : "...", "store": "..." } },
"en": {"buttonENtext": { "goto" : "...", "store": "..." } },
"ua": {"buttonUAtext": { "goto" : "...", "store": "..." } },
"langVar": "$user.lang"
}
}
}
{
"menu": {
"hello": "goto:another-step1",
"world": "goto:another-step2"
}
}
{
"menu": {
"hello": {
"store": "$user.action = 'hello'",
"goto": "another-step"
}
}
}
Use Livescript syntax inside store
Available variables: $user
,$global
{
"menu": {
"button" : {
"ru": {"buttonRUtext": { "goto" : "...", "store": "..." } },
"en": {"buttonENtext": { "goto" : "...", "store": "..." } },
"ua": {"buttonUAtext": { "goto" : "...", "store": "..." } },
"langVar": "$user.lang"
}
}
}
{
"onText": {
"validate": ["^[a-z]+[@][a-z]+$"],
"store": "$user.firstname = $text"
}
}
Use Livescript syntax inside store
Available variables: $user
,$global
, $text
validate
field contains the array of regexp validations
{
"redirectCondition": {
"($user.lang ? '').length is 2": "choose-action-step"
}
}
redirectCondition
is object where
- keys are conditions
- values are step names