Welcome to FTMGram¶
Telegram MTProto API Framework for Python
Homepage •
Development •
v3.5.1 Release •
All Releases •
News
Note
🎉 FTMGram v3.5.1 Released!
Featuring Bot Chat History Scanning (get_bot_chat_history), Turbo Multi-Worker Media Engine (fast_download), In-Message Buttons (<tg-button-row>), AI Token Streaming (stream_text), Fluent RichMessageBuilder DSL, Batch Purge Admin Tools, and Checklists.
Read the Version 3.5.1 release notes for full details!
from ftmgram import Client, filters
app = Client("my_account")
@app.on_message(filters.private)
async def hello(client, message):
await message.reply("Hello from FTMGram v3.5.1!")
app.run()
FTMGram is a modern, elegant and asynchronous MTProto API framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot identity (bot API alternative) using Python.
How the Documentation is Organized¶
Quick Start
Quick Start — An overview showing the first steps to take.
Install Guide — Detailed instructions on how to install FTMGram.
Getting Started
Project Setup — Setup guide.
Authorization — How to obtain your Telegram API ID and Hash.
Invoking Methods — Calling Telegram methods with your Client.
Handling Updates — Registering handlers and listening to updates.
Error Handling — Error handling guide.
Examples — Working code examples for common bot workflows.
API Reference
FTMGram Client — Complete reference of all Client methods.
Methods — Detailed index of all Client methods.
Types — Detailed list of all Telegram types and models.
Bound Methods — Convenience methods bound to types.
Enumerations — Enumerations used across the API.
Update Handlers — Update handlers.
Decorators — Decorators for registering callbacks.
Update Filters — Built-in and custom update filters.
RPC Errors — Telegram RPC and network errors.
Topics & Guides
In-Message Buttons — In-Message Buttons (
<tg-button-row>).AI Response Streaming & Drafts — Live AI Response Token Streaming & Drafts.
Ephemeral Messages — Ephemeral Messages & Overlays.
Checklists & Task Lists — Interactive Checklists & Task Lists.
Text Formatting — Markdown, HTML, and Entities.
Smart Plugins — Modular project layout for large bots.
Storage Engines — File SQLite, In-Memory, and Session Strings.
Creating Filters — Creating custom update filters.
Using Filters — Using filters effectively.
More on Updates — Advanced update mechanisms.
Client Settings — Client configuration options.
Speedups — Maximizing network and CPU throughput.
Proxy Settings — Using SOCKS5 and HTTP proxies.
Scheduling Tasks — Scheduling messages and tasks.
Advanced Usage — Advanced MTProto techniques.
MTProto vs Bot API — MTProto architecture vs HTTP Bot API.
Debugging — Debugging and logging.
Test Servers — Testing on Telegram test DCs.
Voice Calls — Voice call architecture.
Object Serialization — Object serialization.
Synchronous Usage — Running synchronously.
Message identifiers — Message ID schemas.
Comparison with Other FTMGram Forks — Comparison with other libraries.
Releases & Changelog
Version 3.5.1 — Highlights and new methods in v3.5.1.
Release Notes — Full historical release notes and changelog.
Meta
Frequently Asked Questions — Frequently asked questions.
Support FTMGram — Support and Telegram community.