Skip to main content

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
Recommended

For most menu-based bots, use the Menu System nodes instead of raw keyboards!

📖 Interactive Menus Guide →

NodePurpose
menu.showDisplay a menu with automatic back button
menu.paginated_listPaginated menu for large lists
menu.routerRoute callbacks by pattern
menu.wizardMulti-step forms with validation
menu.searchIn-menu search functionality
menu.confirmSimple Yes/No confirmation

⌨️ Types of Keyboards

There are two main types of buttons in Telegram:

TypeAppearanceBehavior
Inline KeyboardButtons attached under a messageClicks trigger callback_query (invisible to chat)
Reply KeyboardButtons replace the user's typing keyboardClicks 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

FieldDescription
DataQuick 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 ReplyMarkup input 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

FieldDescription
DataQuick syntax (e.g. Option 1, Option 2)
ResizeMake buttons smaller (recommended: true)
One TimeHide keyboard after use
PlaceholderText 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

Display an interactive menu with automatic navigation.

SettingDescription
Menu IDUnique identifier
TitleMenu text/header
Buttons Per RowHow many buttons per row
Enable BackShow 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)

Display a paginated list for large datasets.

SettingDescription
Page SizeItems per page (default: 5)
Item TemplateButton text template (e.g., {{name}} - ${{price}})
Callback TemplateCallback data template (e.g., item_{{id}})

Outputs:

  • Same as menu.show plus:
  • 📄 Page: Current page number
  • 📄 TotalPages: Total number of pages

Multi-step form with validation.

SettingDescription
StepsArray of step definitions
Show ProgressShow "Step X/Y" indicator
Allow BackEnable back navigation

Step Types:

  • text — Free text input
  • number — Numeric input
  • select — Button choice
  • confirm — Yes/No
  • photo — Photo upload

Outputs:

  • Completed: All steps done
  • Cancelled: User cancelled
  • 📦 FormData: Collected answers

In-menu search functionality.

SettingDescription
Search FieldsWhich fields to search
Max ResultsResult limit
Item TemplateResult button template

Outputs:

  • Selected: User picked a result
  • Cancelled: Search cancelled
  • 📦 SelectedItem: The selected item
  • 📝 Query: What user searched for

Simple Yes/No confirmation dialog.

SettingDescription
TitleConfirmation question
Yes TextYes button text
No TextNo button text
DestructiveShow warning style

Outputs:

  • Yes: User confirmed
  • No: User declined

Route callbacks using pattern matching.

SettingDescription
RoutesPattern → 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?

NeedUse
Simple inline buttonsmarkup.inline_keyboard
Simple reply keyboardmarkup.reply_keyboard
Single-level menuui.menu
Nested menus with backmenu.show
Large listsmenu.paginated_list
Multi-step formsmenu.wizard
Search functionalitymenu.search
Routing callbacksmenu.router

Learn More