Skip to main content

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots

Project description

Irenogram

Irenogram

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots.

PyPI Python License


Irenogram is a production-ready, actively maintained Pyrogram fork — fully compatible with existing Pyrogram code. Install as irenogram, import as pyrogram. No migration needed.

Features

  • Telegram Bot API 9.6 — Managed Bots, Poll Revolution, Mini App keyboard buttons, new entity types
  • Layer 224 MTProto — full schema coverage, all 2,200+ TL types implemented
  • Managed Bots — create, control and fetch tokens for bots via API
  • Poll Revolution — multiple correct answers, revoting, hidden results, shuffle, dynamic options
  • Entity ExpansionFORMATTED_DATE, DIFF_INSERT, DIFF_REPLACE, DIFF_DELETE
  • Todo/Checklist — full send, append, complete/incomplete support
  • Stable sessions — no unknown constructor errors, fixed MTProto framing
  • Python 3.8+ — fully async, works with asyncio and frameworks

Installation

pip install irenogram

Quick Start

from pyrogram import Client

app = Client("my_account")

@app.on_message()
async def handle(client, message):
    await message.reply("Hello!")

app.run()

Bot API 9.6 Examples

from pyrogram import Client
from pyrogram.types import PollOption, KeyboardButton, RequestPeerTypeManagedBot

app = Client("my_bot", bot_token="...")

@app.on_managed_bot()
async def on_new_managed_bot(client, managed_bot):
    token = await client.get_managed_bot_token(managed_bot.bot_id)
    print(f"New bot token: {token}")

async def main():
    async with app:
        await app.send_poll(
            chat_id="me",
            question="Best language?",
            options=[PollOption("Python"), PollOption("Go"), PollOption("Rust")],
            allows_revoting=True,
            hide_results_until_close=True,
            correct_option_ids=[0],
        )

Links

License

Irenogram is distributed under the terms of the GNU Lesser General Public License v3 (LGPLv3).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

irenogram-2.3.75.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

irenogram-2.3.75-py3-none-any.whl (5.5 MB view details)

Uploaded Python 3

File details

Details for the file irenogram-2.3.75.tar.gz.

File metadata

  • Download URL: irenogram-2.3.75.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for irenogram-2.3.75.tar.gz
Algorithm Hash digest
SHA256 e3ea7dc27dbec9b99cdb0e445b13f62e48d1e68a2b5ae1aad1b1241a823316d2
MD5 1e444f6a983669b212af095b32ab053f
BLAKE2b-256 cc3ebacc4fbc2c586c06580b787ee0dfd37cd44b30aac863ff395a44e8bb90d5

See more details on using hashes here.

File details

Details for the file irenogram-2.3.75-py3-none-any.whl.

File metadata

  • Download URL: irenogram-2.3.75-py3-none-any.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for irenogram-2.3.75-py3-none-any.whl
Algorithm Hash digest
SHA256 0df70db504e4e365cc30ee908474e6be09f69dc33ca765947b99d99e85c6cb38
MD5 b060694e3f08b3e8545d29b4039b32c2
BLAKE2b-256 50301ba5b401ca2c0c8a422f8b649054c473a101a599bcdfe83737b2f29aff5f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page