Multi-Step Dialog
A multi-step dialog lets you collect data from users sequentially: name, phone, address, and other information. Each step waits for the user's response before moving to the next one.
How It Works
The key function is register_next_step. It specifies which step will process the user's next message.
Step 1: question → register_next_step(2)
Step 2: save answer → question → register_next_step(3)
Step 3: save answer → summary
Example: Order Form
Step 1: Ask for Name
send_message: "Let's place an order. What's your name?"
register_next_step: 2
Step 2: Save Name, Ask for Product
add_var: name = {=message=}
send_message: "Great, {=name=}! What product are you interested in?"
register_next_step: 3
Step 3: Save Product, Ask for Address
add_var: product = {=message=}
send_message: "Enter your delivery address:"
register_next_step: 4
Step 4: Confirmation
add_var: address = {=message=}
send_message: "Please verify your order:
Name: {=name=}
Product: {=product=}
Address: {=address=}
Is everything correct?
{buttons:[[Confirm] [Cancel]]}"
Input Validation
Add conditions to validate input:
if "{=message=}" == ""
→ send_message: "Please enter your name"
→ register_next_step: 2 // repeat step
else
→ add_var: name = {=message=}
→ next question