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:
create_community()(supportshiddenparameter)add_chat_to_community()— add a chat to an existing community. Accepts the raw community ID (as returned bylinked_community_idorget_joined_communities()), not the-100-prefixed channel ID. Supportshidden=Trueto add the chat without showing it in the sidebar.
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:
edit_ephemeral_message_text()edit_ephemeral_message_caption()edit_ephemeral_message_media()edit_ephemeral_message_reply_markup()
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().
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 andconfirm_bot_connection(were incorrectly usingmessages.*).Fixed
message_thread_id,EmojiStatusUntilAttributeError,PeerID invalid.Fixed
messages.chatInviteJoinResultWebViewTL ID and replacedwebviewfield withquery_id.Fixed
messages.composedRichMessageWithAITL ID and schema (now returnsRichMessage).Fixed
TypeErroronsend_message()caused by missingephemeral_receiver_bot_idinmessages.SendMessage.
Build¶
Migrated
scrape-errorsCI touv.docs.jsonregenerated for layers 225, 227, 228 (Unicode preserved,ensure_ascii=False).invoke()now has a generic return type.Fixed
async/asynciocompatibility for Python 3.13 & 3.14. CI matrix: 3.10, 3.11, 3.12, 3.13.