Skip to content

Commit f2394be

Browse files
committed
add: example of message parser
1 parent e135156 commit f2394be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

coral-example/sum.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ commands:
77
prefix: "s"
88
command: "um"
99
run_process: True
10-
message: "sum of {{1}} {{2}} {{3}} is sum(1,2,3) {{http://127.0.0.1:8000/}}"
10+
message: "sum of {{1}} {{2}} {{3}} is {{sum(1,2)}} \n\n {{http://127.0.0.1:8000/}}"
1111

1212
process:
1313
timeout: 300
1414
exit_command:
1515
prefix: "st"
1616
command: "op"
1717
message: "good bye"
18-
end_message: "sum of {{first}} {{third}} = {{sum(first,third)}} from all {{sum(first,second,third)}}"
18+
end_message: "sum of {{first}} {{third}} = {{sum(first,third)}} from all {{sum(first,second,third)}} \n\n {{http://127.0.0.1:8000/}}"
1919
questions:
2020
- question:
2121
slug: first
22-
asking: First Question
22+
asking: First Question, and I parse the last argument {{3}}
2323
validation:
2424
rule: ^[0-9]*$
2525
message: "please only number"
2626
- question:
2727
slug: second
28-
asking: Second Question
28+
asking: your answer is {{first}} Second Question, and I parse the first argument {{1}}
2929
validation:
3030
rule: ^[0-9]*$
3131
message: "please only number"
3232
- question:
3333
slug: third
34-
asking: Third Question
34+
asking: your answer is {{second}} Third Question, and I parse all the argument {{1}} {{2}} {{3}}
3535
validation:
3636
rule: ^[0-9]*$
3737
message: "please only number"

0 commit comments

Comments
 (0)