CatalystCode / bot-graph-dialog

graph-bot-dialog
MIT License
32 stars 15 forks source link

REPL Support #19

Open aribornstein opened 8 years ago

aribornstein commented 8 years ago

It would be nice to have support for repl like scenario loops. Since currently this requires an inverse condition to continue the loop and does not provide a print option to let the user know why they answered incorrectly.

This is how i'd REPL today:

"id":"name", "type":"prompt", "data":{ "text":"Greetings what is your name?" }, "varname":"name", "scenarios":[ { "condition":"name == 'Professor Falken'", "steps":[] }, { "condition":"name != 'Professor Falken'", "nodeId":"name" }

It might be interesting if this could support a repl feature

"id":"name", "type":"prompt", "data":{ "text":"Greetings what is your name?" }, "varname":"name", "loop":{ "condition":"name == 'Professor Falken'", "wrongAns":"sorry you aren't authorized " "steps":[] }

If the condition is not met loop will send the the wrong answer message and then set the node id back to parent to reprompt