Skip to main content
In Bots.LT, every piece of logic is triggered by a Command. A command is a specific string or pattern that the platform listens for from the Telegram API.

Command Types

1. Exact Match Commands

The most common type of command. If a user types exactly this string, the corresponding code executes.

2. Wildcard Command (*)

The * command acts as a catch-all. It catches any text message that doesn’t match an exact command. Common Use Cases:
  • Chatbots using AI (ChatGPT/Gemini) that need to process natural language.
  • Catch-all fallback messages (“I don’t understand that command.”).
  • Tracking user state or processing conversational inputs.
BLP Example (AI Chatbot)

3. Before All Command (@)

The @ command is a special middleware command. If it exists, it runs before any other command. Common Use Cases:
  • Checking if a user is banned globally.
  • Enforcing channel membership (Force Sub).
  • Logging user activity before processing their request.
Important: If you call ReturnCommand() inside the @ command, the execution stops immediately, and the actual triggered command will not run.
BLP Example (Ban Check Middleware)

Special Event Handlers

Aside from text messages, Telegram sends other types of updates (like button clicks, photo uploads, or new members joining). Bots.LT maps these events to special built-in command names.
BLP Example (Handling Callbacks)
BLP Example (Handling Photos)