Telegram 'Api'

The `Api` object is a global interface to the [Telegram Bot API](https://core.telegram.org/bots/api). It allows you to call any Telegram method directly using `async/await`. No setup or initialization is required — it's ready to use.

Basic Usage

You can directly call any Telegram Bot API method using Api.<methodName>(params):

Example

Supported Methods

Any method listed in the Telegram Bot API Docs is supported automatically. Here are some common examples:

Get Bot Info

Send a Message

Send a Photo

Batch Api Requests

You can send multiple requests in parallel using:

Usage Data Usage Tracking

The Api instance tracks how much data has been used (in kilobytes):

⚠️ Note: You may have a data usage limit depending on your plan. Avoid sending large payloads or too many requests to stay within your limit.

Api Error Handling

Always check if the response is successful:

Notes

  • Method names must match exactly with the official Telegram API (e.g., sendMessage, getMe, forwardMessage).
  • All keys and values passed in parameters must be strings or serializable values.
  • Data usage may be restricted as per your plan — keep requests optimized.

Telegram API Reference

Refer to the official Telegram Bot API to see a full list of methods and expected parameters.