Skip to content

Global Variables

TBL provides built-in global variables in every command. They give you access to the current update, user, chat, and runtime context without any setup or imports.

Read this section before Bot and Api: instances are what you call; globals are what you read from the current run. After both instance sections, use Bot vs Api to choose between them.

How to Use This Section

Each variable below is documented on its own page with examples and field descriptions. Variables are read-only during command execution unless noted otherwise.

Available Variables

Variable Description
update Full Telegram update object that triggered the command
update_type String name of the update type (e.g. message, callback_query)
request Incoming HTTP request data in webhook mode
message The message object when the update includes one
user The user who triggered the update
chat The chat where the update occurred
bot Metadata about the current bot
owner The bot owner's account information
plan The bot owner's subscription plan details
params URL query parameters in webhook and Webapp commands
options Custom data passed when running a command programmatically
tbl_options Internal options set by TBL for HTTP callbacks and flows
content Parsed content from the current update
msg (global) Shortcut to the current message context (distinct from the msg instance)
error Error details inside the ! error handler command
http_response Response data from HTTP callback commands
process Environment and runtime process information

Important Notes

  • Global variables exist only while a command is running
  • Not every variable is available in every command type (e.g. request is webhook-only)
  • The global msg variable is different from the msg instance — see both pages before using message methods