Buttons & Menus
BotGami allows you to create rich interactive interfaces using Telegram's keyboard features and the powerful Menu System.
🚀 Advanced Menu System
For complex interactive flows, BotGami provides a complete Menu System with:
- Nested Navigation with automatic back buttons
- Pagination for large lists
- Multi-step Forms (Wizards)
- Search functionality
- Callback Routing
For most menu-based bots, use the Menu System nodes instead of raw keyboards!
Menu System Nodes
| Node | Purpose |
|---|---|
| menu.show | Display a menu with automatic back button |
| menu.paginated_list | Paginated menu for large lists |
| menu.router | Route callbacks by pattern |
| menu.wizard | Multi-step forms with validation |
| menu.search | In-menu search functionality |
| menu.confirm | Simple Yes/No confirmation |
⌨️ Types of Keyboards
There are two main types of buttons in Telegram:
| Type | Appearance | Behavior |
|---|---|---|
| Inline Keyboard | Buttons attached under a message | Clicks trigger callback_query (invisible to chat) |
| Reply Keyboard | Buttons replace the user's typing keyboard | Clicks send text messages (visible in chat) |
🧩 Inline Keyboard (markup.inline_keyboard)
Creates buttons attached to a message. Ideal for actions like "Like", "Next Page", or "Buy".
Configuration
| Field | Description |
|---|---|
| Data | Quick syntax to define buttons |
Quick Syntax
Use Label|value to create buttons.
,separates buttons in the same row;creates a new row
Example:
Vote Yes|yes, Vote No|no; More Info|url:https://google.com
Result:
- Row 1: [Vote Yes] [Vote No]
- Row 2: [More Info]
Outputs
- Markup: Connect this to the
ReplyMarkupinput of any Send Message or Edit Message node.
🎹 Reply Keyboard (markup.reply_keyboard)
Creates custom buttons that user can tap to send text. Great for main menus.
Configuration
| Field | Description |
|---|---|
| Data | Quick syntax (e.g. Option 1, Option 2) |
| Resize | Make buttons smaller (recommended: true) |
| One Time | Hide keyboard after use |
| Placeholder | Text shown in input field |
Quick Syntax
Just write the text you want the user to send.
My Account, Support; Settings
📱 UI Menu (ui.menu)
A powerful "Power Node" that combines sending a message, showing a keyboard, and waiting for a choice.
Why use it?
Instead of manually creating a Keyboard → Sending Message → Waiting for Input → Checking Input, use ui.menu to do it all in one step.
Configuration
- Options: List of choices (Key + Label).
- Cancel Key: Key that triggers the "Cancelled" output.
Outputs:
- ⚡ Selected: Fires when a valid option is chosen.
- ⚡ Cancelled: Fires if user cancels.
- 📝 Key: The unique ID of the selected option.
📋 Menu System Nodes
menu.show
Display an interactive menu with automatic navigation.
| Setting | Description |
|---|---|
| Menu ID | Unique identifier |
| Title | Menu text/header |
| Buttons Per Row | How many buttons per row |
| Enable Back | Show back button (auto if nested) |
Outputs:
- ⚡ Selected: User clicked a button
- ⚡ Back: User clicked back (no parent menu)
- 📦 SelectedItem: The clicked item
- 🔢 SelectedIndex: Button position (0-based)
menu.paginated_list
Display a paginated list for large datasets.
| Setting | Description |
|---|---|
| Page Size | Items per page (default: 5) |
| Item Template | Button text template (e.g., {{name}} - ${{price}}) |
| Callback Template | Callback data template (e.g., item_{{id}}) |
Outputs:
- Same as menu.show plus:
- 📄 Page: Current page number
- 📄 TotalPages: Total number of pages
menu.wizard
Multi-step form with validation.
| Setting | Description |
|---|---|
| Steps | Array of step definitions |
| Show Progress | Show "Step X/Y" indicator |
| Allow Back | Enable back navigation |
Step Types:
text— Free text inputnumber— Numeric inputselect— Button choiceconfirm— Yes/Nophoto— Photo upload
Outputs:
- ⚡ Completed: All steps done
- ⚡ Cancelled: User cancelled
- 📦 FormData: Collected answers
menu.search
In-menu search functionality.
| Setting | Description |
|---|---|
| Search Fields | Which fields to search |
| Max Results | Result limit |
| Item Template | Result button template |
Outputs:
- ⚡ Selected: User picked a result
- ⚡ Cancelled: Search cancelled
- 📦 SelectedItem: The selected item
- 📝 Query: What user searched for
menu.confirm
Simple Yes/No confirmation dialog.
| Setting | Description |
|---|---|
| Title | Confirmation question |
| Yes Text | Yes button text |
| No Text | No button text |
| Destructive | Show warning style |
Outputs:
- ⚡ Yes: User confirmed
- ⚡ No: User declined
menu.router
Route callbacks using pattern matching.
| Setting | Description |
|---|---|
| Routes | Pattern → Output mappings |
Each route has:
- Pattern: Regex pattern (e.g.,
^product_(\d+)$) - Output: Output socket name
- Params: Extracted parameter names
Outputs:
- ⚡ Dynamic outputs based on routes
- ⚡ Fallback: No pattern matched
- 📦 Params: Extracted parameters
When to Use What?
| Need | Use |
|---|---|
| Simple inline buttons | markup.inline_keyboard |
| Simple reply keyboard | markup.reply_keyboard |
| Single-level menu | ui.menu |
| Nested menus with back | menu.show |
| Large lists | menu.paginated_list |
| Multi-step forms | menu.wizard |
| Search functionality | menu.search |
| Routing callbacks | menu.router |
Learn More
- Interactive Menus Guide → — Complete menu system tutorial
- Keyboards & Buttons → — Low-level button customization