Back to Blog
TJS (Telebot Host) TBL Reference

Global Predefined Values in TBL: User, Chat, Bot and More

Global Predefined Values

TBL provides a set of predefined global variables. These are available in every command, so you don't need to declare them manually. They make it easier to work with Telegram updates, users, chats, and the bot itself.

update

The raw Telegram update object. Contains everything Telegram sends (messages, edits, queries, etc.).

request

Simplified version of update. TBL automatically detects the type of update. When the update type is message then request will be update.message. In Webhook request object contains info like ip, body, params, header etc.

message

Contains only the text of a message (if applicable).

JAVASCRIPT
"Hello bot"

user

Information about the user interacting with the bot.

JAVASCRIPT
{
  "id": 5723455420,
  "is_bot": false,
  "first_name": "Soumyadeep ∞",
  "username": "soumyadeepdas765",
  "language_code": "en",
  "is_premium": true,
  "last_name": "",
  "telegramid": 5723455420,
  "premium": true,
  "blocked": false,
  "block_reason": null,
  "blocked_at": null,
  "just_created": false
}

chat

Details about the current chat (private, group, or channel).

JAVASCRIPT
{
  "id": 5723455420,
  "first_name": "Soumyadeep ∞",
  "username": "soumyadeepdas765",
  "type": "private",
  "chatid": 5723455420,
  "chatId": 5723455420,
  "blocked": false,
  "block_reason": null,
  "blocked_at": null,
  "just_created": true
}

bot

Information about the bot including owner, status, and platform info.

JAVASCRIPT
{
  "id": 42,
  "token": "123456:ABC...",
  "name": "DemoBot",
  "bot_id": 987654321,
  "owner": "[email protected]",
  "status": "working",
  "created_at": "2025-01-01",
  "updated_at": "2025-01-10"
}

Other Predefined Values

  • sleep() - Pause execution up to 10,000 ms
  • plan - User's subscription details
  • owner - Bot owner information
  • params - Extra text after a command
  • options - Custom data passed between commands
  • content - Response body from HTTP requests
  • inspect() - Helper function to print any object for debugging
  • msg - Simplified version of update for message updates
  • error - Information about errors caught by ! command
  • require - Import functions from another command

📚 Source

This tutorial is based on the official TeleBotHost TBL Documentation. Visit their site for the most up-to-date information and advanced guides.

Share this tutorial