qmetrics.net

python-telegram-bot

Asynchronous Python framework for Telegram bots

python-telegram-bot screenshot

python-telegram-bot is a Python package that implements the Telegram Bot API with asyncio. The telegram.ext module adds high-level handlers for polling, webhooks, jobs, and conversation flows.

Overview

python-telegram-bot lets developers build Telegram chatbots in Python using a typed, asynchronous interface to the official Bot API. The core package maps API types and methods; the telegram.ext submodule supplies application scaffolding, command and message handlers, and helpers aimed at everyday bot development.

The library targets Python 3.11 and newer and is built on asyncio. It supports webhook and long-polling delivery models, shortcut helpers such as replying from a Message object, and optional extras for rate limiting, callback data, scheduled jobs, SOCKS proxies, and webhook serving when installed with named dependency groups.

Networking defaults to httpx. Optional integrations include APScheduler for job queues, cachetools for arbitrary callback data, and aiolimiter for rate limiting. Documentation, wiki guides, and example bots illustrate patterns from minimal echo bots to more structured handlers.

Bots you write with the package run as your own Python process using a bot token from Telegram; the library itself is not a hosted bot service.

Key features

  • Native Telegram Bot API coverage
  • Async asyncio-based architecture
  • telegram.ext handlers and Application class
  • Webhook and polling integration
  • Static type hints throughout
  • Optional job queue and rate limiter
  • Shortcut methods on message objects
  • pip install with optional feature extras

Use cases

  • Command-driven Telegram chatbots
  • Customer notification bots
  • Interactive conversation flows
  • Webhook-hosted bot backends
  • Scheduled messages via job queue

Tags

Similar software

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

OkHttp

HTTP client for JVM, Android, and GraalVM

OkHttp is an HTTP client library tuned for efficient networking on Android, Java, and GraalVM native images. It offers synchronous and asynchronous call APIs with a fluent request builder.

★ 47.1k⟳ yesterdayApache-2.0
Frameworks & PlatformsDesktop/CLI app

gRPC

Cross-language remote procedure call framework

gRPC is an RPC framework that lets client and server programs communicate transparently and supports building connected, multi-language systems.

★ 45.5k⟳ todayApache-2.0

tRPC

End-to-end typesafe TypeScript APIs without code generation

tRPC helps teams define server procedures and call them from clients with full TypeScript types for inputs, outputs, and errors—no schemas or codegen step.

★ 40.9k⟳ todayMIT
Frameworks & PlatformsDesktop/CLI app

go-zero

Cloud-native Go microservices and RPC framework

go-zero is a Go web and RPC framework with code generation, built-in resilience middleware, and tooling aimed at stable high-traffic services.

★ 33.5k⟳ 9 days agoMIT