Interactive Menus & Wizards
Build user-friendly navigation systems, multi-step forms, and guided experiences using BotGami's menu nodes.
Why Menus?โ
Benefits:
- โ Visual: Buttons instead of text commands
- โ Intuitive: Clear options for users
- โ State Management: Automatic navigation tracking
- โ Mobile-Friendly: Works great on phones
Use Cases:
- Product catalogs with pagination
- Multi-step registration/booking
- Settings panels
- Help systems
- E-commerce checkouts
[Screenshot: Example multi-level menu with categories and products]
Menu Basicsโ
Anatomy of a Menuโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Choose a category: โ โ Message
โ โ
โ [๐ Food] [๐ฎ Games] โ โ Buttons (Row 1)
โ [๐ Books] [๐ Home] โ โ Buttons (Row 2)
โ [โ Back] โ โ Navigation
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
menu.show Structureโ
[menu.show]
Message: "Choose a category:"
Items: [
{ label: "๐ Food", data: "food" },
{ label: "๐ฎ Games", data: "games" },
{ label: "๐ Books", data: "books" },
{ label: "๐ Home", data: "home" }
]
Columns: 2 // 2 buttons per row
AllowBack: true
Outputs:
food โ [Show Food Subcategory]
games โ [Show Games]
books โ [Show Books]
home โ [Return to Main]
Back โ [menu.navigate_back]
Multi-Level Navigationโ
Pattern: Main โ Category โ Itemโ
[Main Menu]
"What are you looking for?"
[๐๏ธ Shop] [โน๏ธ Info]
โ Shop
[Category Menu]
"Choose category:"
[Electronics] [Clothing] [Books]
[โ Back]
โ Electronics
[Electronics List - Paginated]
Shows 5 items per page
[Item 1] [Item 2] ...
[โ๏ธ Prev] [Next โถ๏ธ]
[โ Back]
โ Item 1
[Item Detail]
"Product: Laptop Pro
Price: $999
Rating: โญโญโญโญโญ"
[๐ Add to Cart] [โค๏ธ Save]
[โ Back to list]
Implementation:
--- Main ---
[menu.show - main_menu]
Items: [
{ label: "๐๏ธ Shop", data: "shop" },
{ label: "โน๏ธ Info", data: "info" }
]
shop โ [category_menu]
--- Categories ---
[menu.show - category_menu]
Items: [
{ label: "๐ป Electronics", data: "electronics" },
{ label: "๐ Clothing", data: "clothing" }
]
AllowBack: true
electronics โ [electronics_list]
Back โ [menu.navigate_back] // Goes to main_menu
--- Product List ---
[HTTP GET /api/products?category=electronics]
โ products array
[menu.paginated_list]
Items: {{products}}
PageSize: 5
ItemTemplate: "{{name}} - ${{price}}"
ItemSelected โ product_detail
--- Product Detail ---
[data.object_get]
Object: {{selected_product}}
โ All fields
[menu.show]
Message: "**{{name}}**
Price: ${{price}}
{{description}}"
Items: [
{ label: "๐ Add to Cart", data: "add_cart" },
{ label: "โค๏ธ Wishlist", data: "wishlist" }
]
AllowBack: true
add_cart โ [Add to cart flow]
Back โ [menu.navigate_back] // Returns to product list
[Screenshot: 4-level navigation showing mainโcategoryโlistโdetail]
Wizards (Multi-Step Forms)โ
menu.wizardโ
Best for collecting multiple pieces of information in sequence.
Example: User Registration
[menu.wizard - user_registration]
Steps: [
{
name: "full_name",
message: "๐ค What's your full name?",
type: "text"
},
{
name: "email",
message: "๐ง Enter your email address:",
type: "text",
validation: "email" // Built-in email validation
},
{
name: "age",
message: "๐ How old are you?",
type: "number",
validation: "value >= 13"
},
{
name: "plan",
message: "Choose your plan:",
type: "choice",
buttons: [
{ label: "Free", data: "free" },
{ label: "Pro - $9/mo", data: "pro" },
{ label: "Enterprise", data: "enterprise" }
]
},
{
name: "confirm",
message: "โ
Review your info:
Name: {{full_name}}
Email: {{email}}
Age: {{age}}
Plan: {{plan}}
Is this correct?",
type: "choice",
buttons: [
{ label: "โ
Yes, create account", data: "yes" },
{ label: "โ Start over", data: "no" }
]
}
]
AllowBack: true
SaveProgress: true // Resume if user abandons
Complete โ [Process registration]
Data: {
full_name: "John Doe",
email: "john@example.com",
age: 25,
plan: "pro",
confirm: "yes"
}
Cancel โ [Send: "Registration cancelled"]
[Screenshot: Wizard progression showing step 2 of 5]
Validation Types:
emailโ Valid email formatphoneโ Phone numbernumberโ Must be numericurlโ Valid URL- Custom expression:
value >= 18 and value <= 100
Paginationโ
menu.paginated_listโ
For long lists (products, users, search results).
Example: Product Catalog (100+ items)
[HTTP GET /api/products]
โ 150 products
[menu.paginated_list]
Items: {{products}}
PageSize: 8
ItemTemplate: "{{name}} - ${{price}}"
Header: "๐๏ธ Products (Page {{page}}/{{total_pages}})"
Footer: "Total: {{total_items}} items"
Shows:
๐๏ธ Products (Page 1/19)
Laptop Pro - $999
Mouse Wireless - $25
Keyboard RGB - $75
Monitor 27" - $350
Webcam HD - $120
Headphones - $80
USB Hub - $30
Cable HDMI - $15
Total: 150 items
[โ๏ธ Previous] [Next โถ๏ธ]
[๐ Search] [๐ Main Menu]
ItemSelected โ [Show product detail]
Search โ [menu.search on same dataset]
[Screenshot: Paginated list showing page 3 of 10]
Pro Tips:
- Keep PageSize between 5-10 for mobile
- Show page numbers in header
- Add search option for long catalogs
Dynamic Menus from Dataโ
menu.from_dataโ
Generate menu buttons from API responses or database queries.
Example: User's Saved Items
[db.search_users]
Filter: user_id == {{user.id}}
โ User
[data.object_get]
Object: {{User.metadata}}
Key: "saved_items"
โ saved_items (array of product IDs)
[HTTP POST /api/products/batch]
Body: { "ids": {{saved_items}} }
โ products array
[menu.from_data]
DataSource: {{products}}
LabelTemplate: "{{name}} - ${{price}}"
DataTemplate: "view_{{id}}"
Message: "โค๏ธ Your Saved Items:"
Generates:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โค๏ธ Your Saved Items: โ
โ โ
โ [Laptop Pro - $999 ] โ
โ [Headphones - $80 ] โ
โ [Mouse - $25 ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Each button's callback_data: "view_123", "view_456", etc.
Search Menusโ
menu.searchโ
Let users search through data.
Example: User Directory
[db.search_users]
Filter: tags contains "active"
โ users array
[menu.search]
Items: {{users}}
SearchableFields: ["first_name", "last_name", "username"]
ResultTemplate: "{{first_name}} (@{{username}})"
MaxResults: 10
Placeholder: "Type name to search..."
User types: "john"
Shows:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Search results for "john": โ
โ โ
โ [John Doe (@johndoe) ] โ
โ [Johnny Smith (@jsmith) ] โ
โ [John Wilson (@jwilson) ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Confirmation Dialogsโ
menu.confirmโ
Simple yes/no prompts.
Example: Delete Confirmation
User clicks "Delete Account"
โ
[menu.confirm]
Message: "โ ๏ธ **Delete Account?**
This will permanently delete all your data.
This action cannot be undone.
Are you absolutely sure?"
YesLabel: "๐๏ธ Yes, delete everything"
NoLabel: "โ No, keep my account"
Yes โ [Execute deletion]
No โ [Send: "โ
Account preserved"]
[Screenshot: Confirmation dialog with warning styling]
Settings Togglesโ
menu.toggleโ
ON/OFF switches for settings.
Example: Notification Settings
[menu.show]
Message: "โ๏ธ Settings"
Items: [
{ label: "๐ Notifications", data: "notifications" },
{ label: "๐ Dark Mode", data: "darkmode" }
]
notifications โ
[menu.toggle]
Variable: "var.notifications_enabled"
OnLabel: "๐ Notifications: ON"
OffLabel: "๐ Notifications: OFF"
Message: "Get notified about updates?"
Current state shown, user clicks to toggle
Updates var.notifications_enabled automatically
Best Practicesโ
1. Button Limitsโ
โ
Max 8 buttons per menu (mobile-friendly)
โ
Use pagination for more
โ Don't cram 20 buttons
2. Clear Labelsโ
โ
"๐ View Cart (3 items)"
โ
"๐ณ Checkout - $45.99"
โ "opt_a"
โ "Click here"
3. Always Provide Backโ
[menu.show]
AllowBack: true // โ Always!
Back โ [menu.navigate_back]
4. Visual Hierarchyโ
Use emojis for categories:
๐ โ Home/Main
โ๏ธ โ Settings
โน๏ธ โ Info/Help
๐ โ Shopping
๐ โ Stats/Reports
5. State Managementโ
โ
menu.navigate_back - automatic breadcrumbs
โ
menu.reset - return to main after flows
โ Manual state tracking - error-prone
Common Patternsโ
Pattern 1: Settings Panelโ
Main โ Settings โ Subsection โ Toggle/Edit โ Back โ Back โ Main
Pattern 2: E-Commerceโ
Main โ Categories โ Products (paginated) โ Product Detail โ Add to Cart โ Checkout
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
(Back navigation)
Pattern 3: Help Systemโ
Main โ Help Topics โ Topic Articles (search) โ Article Detail โ Was this helpful? (confirm)
Pattern 4: Onboarding Wizardโ
Welcome โ [wizard: steps 1-5] โ Complete setup โ Main Menu
Complete Example: Pizza Ordering Botโ
--- Start ---
[/start command]
โ
[menu.show - main]
"๐ Welcome to Pizza Bot!"
[๐ Order Now] [๐ My Orders] [โน๏ธ About]
Order Now โ
--- Pizza Selection ---
[menu.from_data]
DataSource: [
{ id: 1, name: "Margherita", price: 12 },
{ id: 2, name: "Pepperoni", price: 14 },
{ id: 3, name: "Hawaiian", price: 13 }
]
LabelTemplate: "{{name}} - ${{price}}"
Message: "Choose your pizza:"
pizza_1 โ
--- Size Selection ---
[menu.show]
Message: "Margherita selected. Choose size:"
Items: [
{ label: "Small - $12", data: "small" },
{ label: "Medium - $15", data: "medium" },
{ label: "Large - $18", data: "large" }
]
AllowBack: true
medium โ [Save selection]
--- Confirmation ---
[menu.confirm]
Message: "**Order Summary:**
Pizza: Margherita (Medium)
Price: $15.00
Confirm order?"
YesLabel: "โ
Place Order"
NoLabel: "โ Cancel"
Yes โ
--- Payment ---
[menu.show]
"๐ณ Payment Method:"
[Credit Card] [PayPal] [Cash on Delivery]
โ Process payment โ Success!
[menu.reset - Return to main menu]
Troubleshootingโ
Issue: Clicking Back goes to wrong menu
Fix: Use menu.navigate_back - tracks history automatically
Issue: Menu buttons not appearing
Check: Items array format, label field exists
Issue: Can't return to main after wizard
Fix: Use menu.reset after completion
Quick Referenceโ
| Node | Use For |
|---|---|
menu.show | Basic choice menus |
menu.wizard | Multi-step forms (3+ steps) |
menu.paginated_list | Long lists (10+ items) |
menu.from_data | Dynamic menus from APIs |
menu.search | Searchable directories |
menu.confirm | Yes/No dialogs |
menu.toggle | Settings switches |
menu.navigate_back | Back button behavior |
menu.reset | Return to specific menu |
Next Stepsโ
- Menu Nodes Reference โ โ Complete node docs
- Flow Control โ โ Questions and forms