Skip to main content

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]


Anatomy of a Menuโ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Choose a category: โ”‚ โ† Message
โ”‚ โ”‚
โ”‚ [๐Ÿ• Food] [๐ŸŽฎ Games] โ”‚ โ† Buttons (Row 1)
โ”‚ [๐Ÿ“š Books] [๐Ÿ  Home] โ”‚ โ† Buttons (Row 2)
โ”‚ [โ† Back] โ”‚ โ† Navigation
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
[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)โ€‹

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 format
  • phone โ€” Phone number
  • number โ€” Must be numeric
  • url โ€” Valid URL
  • Custom expression: value >= 18 and value <= 100

Paginationโ€‹

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โ€‹

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โ€‹

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โ€‹

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โ€‹

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โ€‹

NodeUse For
menu.showBasic choice menus
menu.wizardMulti-step forms (3+ steps)
menu.paginated_listLong lists (10+ items)
menu.from_dataDynamic menus from APIs
menu.searchSearchable directories
menu.confirmYes/No dialogs
menu.toggleSettings switches
menu.navigate_backBack button behavior
menu.resetReturn to specific menu

Next Stepsโ€‹