Skip to main content

Trigger Nodes

Triggers are the starting points of your flows. They listen for events from Telegram and start execution when criteria are met.


🎯 Universal Trigger (trigger.on)

The Universal Trigger is the most powerful node in BotGami. It can listen for almost anything using a simple filter language.

Configuration

SettingDescription
FilterA query string defining what updates to catch.

Common Filters

Filter QueryListens ForDynamic Outputs
message:textText messagesText, Message
message:photoPhotosPhoto, Caption, FileID
message:voiceVoice notesVoice, Duration, FileID
buttonAny button clickData, Message
my_chat_memberBot added/removedNewStatus, User

Dynamic Outputs

This node is smart. When you change the filter, the output sockets change automatically!

  • If you use message:photo, you get a Photo socket.
  • If you use message:location, you get Latitude and Longitude sockets.

⚡ Command Trigger (trigger.command)

A simplified trigger specifically for matching commands.

SettingDescription
CommandThe command to listen for (e.g., /start, /help).

Outputs:

  • Message: The full text of the message.
  • Args: A list of arguments (e.g., /start promo_code -> ["promo_code"]).

⏰ Schedule Triggers

Cron Trigger (sys.cron_trigger)

Fires periodically based on a CRON schedule (e.g., "Every Monday at 9am").

  • Expression: 0 9 * * 1

Scheduled Task (sys.scheduled_trigger)

Fires when a delayed task (set by a Schedule flow node) executes.


System Triggers

🏁 Start Up (sys.on_start)

Runs once when the bot boots up. Use this to initialize global variables or load configurations.

Note: No user context is available here!

⚠️ Error Handler (sys.on_error)

Catches any unhandled errors from other flows. Connect this to logging logic to keep track of bugs.


Trigger Priority

  1. System Triggers (Level 0) run on startup.
  2. Global Triggers (Level 1) run on every message (good for spam filters or maintenance mode checks).
  3. Conversation Triggers (Level 2) are your standard trigger.on and trigger.command nodes.