# tdlib/telegram-bot-api

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tdlib-telegram-bot-api).**

4,296 stars · 853 forks · C++ · BSL-1.0

## Links

- GitHub: https://github.com/tdlib/telegram-bot-api
- Homepage: https://core.telegram.org/bots
- awesome-repositories: https://awesome-repositories.com/repository/tdlib-telegram-bot-api.md

## Description

This project is a self-hosted Telegram Bot API server that implements a REST gateway to manage bots independently of official cloud infrastructure. It functions as messaging platform middleware, utilizing a translation layer to convert high-level REST API calls into low-level functions via a TDLib-based core.

The server allows for local hosting, which enables the removal of cloud file size limits for uploads and downloads and the use of arbitrary local IP addresses and ports for webhook delivery. It provides a local file system storage mechanism for handling large files and supports session-based state persistence to facilitate the migration of bot instances between server environments.

The system covers a broad range of bot capabilities, including the delivery of rich media, interactive polls, and HTML5 games, as well as the hosting of mini applications. It includes tools for business account automation, forum topic organization, and monetization features such as payment processing and subscription management. Administrative utilities are also provided for chat member management, user verification, and bulk broadcast coordination.

The server source code can be compiled into a binary for various operating systems to enable local deployment.

## Tags

### DevOps & Infrastructure

- [Bot API Server Self-Hosting](https://awesome-repositories.com/f/devops-infrastructure/bot-api-server-self-hosting.md) — Implements a self-hosted HTTP server to manage bot operations independently of cloud infrastructure.

### Data & Databases

- [Local File Storage](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage/file-based-storage/local-file-storage.md) — Uses local file system storage to handle large file transfers beyond cloud-imposed limits.
- [Direct Local Path Access](https://awesome-repositories.com/f/data-databases/file-system-access/direct-local-path-access.md) — Allows direct access to files via local paths to eliminate the need for separate HTTP download requests. ([source](https://cdn.jsdelivr.net/gh/tdlib/telegram-bot-api@master/README.md))

### Development Tools & Productivity

- [REST Gateways](https://awesome-repositories.com/f/development-tools-productivity/rest-apis/mcp-protocol-adapters/rest-gateways.md) — Implements a translation layer that converts high-level REST API calls into low-level TDLib functions.
- [Session State Persistence](https://awesome-repositories.com/f/development-tools-productivity/database-session-management/session-state-persistence.md) — Persists bot states and user sessions in local directories to facilitate server migration.

### Networking & Communication

- [Bot File Management](https://awesome-repositories.com/f/networking-communication/bot-file-management.md) — Coordinates the retrieval of file information and prepares media files for download from the server. ([source](https://core.telegram.org/bots/api))
- [Messaging Middleware](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/communication-platforms/messaging-middleware.md) — Functions as a bridge translating external HTTP requests into platform-specific actions for bots.
- [Telegram Webhook Receivers](https://awesome-repositories.com/f/networking-communication/incoming-webhooks/telegram-webhook-receivers.md) — Configures specific URLs to receive real-time HTTPS POST updates whenever an event occurs. ([source](https://core.telegram.org/bots/api))
- [Messaging Protocol Cores](https://awesome-repositories.com/f/networking-communication/messaging-protocol-cores.md) — Utilizes a low-level client library to handle messaging network protocols, encryption, and state.
- [Transfer Limit Overrides](https://awesome-repositories.com/f/networking-communication/remote-file-downloads/telegram-file-transfers/transfer-limit-overrides.md) — Removes official cloud restrictions on upload and download sizes when running the API server locally. ([source](https://cdn.jsdelivr.net/gh/tdlib/telegram-bot-api@master/README.md))
- [Long-Polling Event Pushing](https://awesome-repositories.com/f/networking-communication/remote-procedure-calls/long-polling-event-pushing.md) — Uses a request-response mechanism that holds connections open until new events trigger a response.
- [Rich Media Transmission](https://awesome-repositories.com/f/networking-communication/rich-media-transmission.md) — Transmits photos, videos, audio, documents, animations, and voice notes to target chats via the API. ([source](https://core.telegram.org/bots/api))
- [Update Polling](https://awesome-repositories.com/f/networking-communication/telegram-api-integrations/update-polling.md) — Implements a long-polling mechanism to retrieve incoming updates from the server in a continuous loop. ([source](https://core.telegram.org/bots/api))
- [Telegram Bot Frameworks](https://awesome-repositories.com/f/networking-communication/telegram-bot-frameworks.md) — Implements the core API gateway necessary for building interactive agents on the Telegram platform.
- [Text Message Transmission](https://awesome-repositories.com/f/networking-communication/text-message-transmission.md) — Implements the transmission of formatted text messages and interactive keyboards through the bot API. ([source](https://core.telegram.org/bots/api))
- [Standardized Event Webhook Delivery](https://awesome-repositories.com/f/networking-communication/webhook-delivery-systems/standardized-event-webhook-delivery.md) — Implements a push-based system for delivering real-time event updates via HTTPS POST requests.
- [Session Migration](https://awesome-repositories.com/f/networking-communication/bot-session-protocols/bot-state-management/session-migration.md) — Enables the transfer of bot instances across local server environments by moving session subdirectories. ([source](https://cdn.jsdelivr.net/gh/tdlib/telegram-bot-api@master/README.md))
- [Bulk Senders](https://awesome-repositories.com/f/networking-communication/broadcast-messaging-channels/bulk-senders.md) — Sends high-volume messages to subscribers using a paid system to bypass standard rate limits. ([source](https://core.telegram.org/bots/api-changelog))
- [Business Account Configuration](https://awesome-repositories.com/f/networking-communication/business-account-configuration.md) — Provides capabilities to handle profile details, settings, and messaging on behalf of connected business accounts. ([source](https://core.telegram.org/bots/api))
- [Business Account Integration](https://awesome-repositories.com/f/networking-communication/chat-bot-integrations/business-account-integration.md) — Enables the integration of bots with professional business accounts to automate messages and profile settings. ([source](https://core.telegram.org/bots))
- [Custom Webhook Delivery](https://awesome-repositories.com/f/networking-communication/incoming-webhooks/telegram-webhook-receivers/custom-webhook-delivery.md) — Provides the ability to route webhooks using local IP addresses to bypass cloud network restrictions. ([source](https://cdn.jsdelivr.net/gh/tdlib/telegram-bot-api@master/README.md))
- [Webhook Connectivity Tuning](https://awesome-repositories.com/f/networking-communication/incoming-webhooks/telegram-webhook-receivers/webhook-connectivity-tuning.md) — Enables the use of arbitrary local IP addresses and ports while increasing maximum concurrent webhook connections. ([source](https://cdn.jsdelivr.net/gh/tdlib/telegram-bot-api@master/README.md))
- [Inline Query Processors](https://awesome-repositories.com/f/networking-communication/inline-query-processors.md) — Processes inline search queries to provide interactive result lists for users to send. ([source](https://core.telegram.org/bots/api))

### Software Engineering & Architecture

- [Protocol Translation Layers](https://awesome-repositories.com/f/software-engineering-architecture/protocol-translation-layers.md) — Provides a translation layer that converts high-level REST API calls into low-level TDLib functions.

### User Interface & Experience

- [Rich Messenger Interfaces](https://awesome-repositories.com/f/user-interface-experience/rich-messenger-interfaces.md) — Supports the creation of mini apps, HTML5 games, and complex polls to provide rich user interfaces.
- [Mini Application Hosting](https://awesome-repositories.com/f/user-interface-experience/mobile-web-integration/web-application-integration/mini-application-hosting.md) — Supports embedding web-based mini applications with access to local storage and geolocation. ([source](https://core.telegram.org/bots/api-changelog))

### Business & Productivity Software

- [Chatbot Monetization](https://awesome-repositories.com/f/business-productivity-software/chatbot-monetization.md) — Processes payments, manages subscriptions, and handles digital gifts within the chat interface.
- [Payment Processing Systems](https://awesome-repositories.com/f/business-productivity-software/payment-processing-systems.md) — Processes invoices, creates payment links, and manages refunds using virtual currency or third-party providers. ([source](https://core.telegram.org/bots/api))

### Web Development

- [Mini App Runtimes](https://awesome-repositories.com/f/web-development/mini-app-runtimes.md) — Provides a runtime environment for hosting custom JavaScript mini-applications embedded within the messenger. ([source](https://core.telegram.org/bots))
