PyrogramMod v2.4.0

Layer 228, Communities, Ephemeral Messages, Rich Messages, Guard Bot and more

Layer Updates

Updated API schema through layers 221 -> 228.

Communities

New communities.* namespace with 10 methods:

Monoforum / Direct Messages

New methods for channels with Direct Messages (monoforum) enabled:

  • toggle_direct_messages() — enable or disable Direct Messages on a broadcast channel.

  • get_monoforum_dialogs() — list per-sender sublists.

  • get_monoforum_history() — read a sender’s sublist history.

  • read_monoforum_history() — mark a sublist as read.

  • delete_monoforum_history() — delete a sublist’s history.

Ephemeral Messages

New ephemeral.* namespace — bot-private messages visible only to the receiver:

Rich Messages (Bot API 10.1)

New types: RichMessage, RichText, RichBlock, InputRichMessage, PollLink.

New enums: RichTextType (26 variants), RichBlockType (30 variants).

New methods:

Incoming Message objects expose the new rich_message field.

Guard Bot & Join Request Queries

New handler on_guard_bot_query(), new type GuardBotQuery, new field ChatJoinRequest.query_id.

Streaming Text

  • send_streaming_text() — stream text progressively to a chat (bots only). Accepts a plain string or an async iterator/generator.

Bot & Browser Settings

User & Chat

New User fields: color, profile_color, bot_active_users, bot_has_main_app.

New Chat fields: guard_bot_id, send_paid_messages_stars, monoforum, autotranslation.

New type PeerColor.

ChatPrivileges gains: can_manage_direct_messages, can_manage_ranks, can_manage_linked_peers.

New update UpdateBotStarsSubscription — fires when a bot Stars subscription is created, canceled, or restored.

New method get_poll_stats().

New field linked_community_id on User and Chat.

Styled Keyboards

InlineKeyboardButton and KeyboardButton now accept a style parameter. New type KeyboardButtonStyle.

Bug Fixes

  • Session reconnect deadlock fixed.

  • account.* namespace corrected for web browser methods and confirm_bot_connection (were incorrectly using messages.*).

  • Fixed message_thread_id, EmojiStatusUntil AttributeError, PeerID invalid.

  • Fixed messages.chatInviteJoinResultWebView TL ID and replaced webview field with query_id.

  • Fixed messages.composedRichMessageWithAI TL ID and schema (now returns RichMessage).

  • Fixed TypeError on send_message() caused by missing ephemeral_receiver_bot_id in messages.SendMessage.

Build

  • Migrated scrape-errors CI to uv.

  • docs.json regenerated for layers 225, 227, 228 (Unicode preserved, ensure_ascii=False).

  • invoke() now has a generic return type.

  • Fixed async/asyncio compatibility for Python 3.13 & 3.14. CI matrix: 3.10, 3.11, 3.12, 3.13.