PyroFork

raw JSON →
2.3.69 verified Mon Apr 27 auth: no python

PyroFork is a fork of Pyrogram, an elegant, modern and asynchronous Telegram MTProto API framework for Python. It supports user and bot accounts, with full async support. Current version: 2.3.69, released regularly.

pip install pyrofork
error ModuleNotFoundError: No module named 'pyrofork'
cause Attempting to import from 'pyrofork' instead of 'pyrogram'.
fix
Install pyrofork package, but use 'from pyrogram import ...'.
error ConnectionError: Unable to connect to Telegram
cause Missing or incorrect API_ID/API_HASH, or firewall blocking MTProto.
fix
Ensure API_ID and API_HASH are correct and network allows MTProto (port 443).
gotcha Import paths: PyroFork uses 'pyrogram' as the package name, NOT 'pyrofork'. Many users mistakenly import from pyrofork.
fix Use 'from pyrogram import Client' instead of 'from pyrofork import Client'.
breaking PyroFork may have breaking changes compared to upstream Pyrogram. Check CHANGELOG before upgrading from Pyrogram.
fix Review the PyroFork changelog on GitHub and adjust code accordingly.

Basic async client initialization. Ensure API_ID and API_HASH are set.

import asyncio
from pyrogram import Client

api_id = os.environ.get('API_ID', '')
api_hash = os.environ.get('API_HASH', '')

async def main():
    async with Client("my_account", api_id=api_id, api_hash=api_hash) as app:
        await app.send_message("me", "Hello from PyroFork!")

asyncio.run(main())