Released on Dec 23, 2020
Layer 122, Performance gains, Bot API file ids and more¶
The API schema has been updated to Layer 122 adding support for group calls (voice chats), channel comments, multiple message pins, message replies and more.
Performance improvements: some critical parts were optimized to allow the async event loop running smoother; other parts have been optimized as well to avoid unnecessary computations.
Added support for the newest Bot API file ids: the
file_refparameter is now useless and has been removed from the API in favour of a single
file_unique_idparameter has also been added to media types, making Pyrogram file ids 100% compatible with the Bot API. This means all file ids (old and new) you take or might have taken from the Bot API will work with Pyrogram, and vice-versa.
Pyrogram’s raw API reference docs have been enhanced: you can now find a description to methods, types and constructors, as well as each combinator’s argument (when available and applicable). This will allow people to better understand how to use the vast Telegram low-level API.
Pyrogram is now fully independent on the system clock. This means that any modification to the system clock will not make Pyrogram misbehave anymore because the internal clock used is now synced with Telegram servers instead.
Added initial automated test suites for Python 3.6, 3.7, 3.8 and 3.9 in Linux, Windows and macOS environments.
Added the ability to manually pass text entities to methods instead of specifying the
Added support for anonymous messages: added the
sender_chatattribute to Message objects.
Added support for anonymous chat members: added
is_anonymousattribute to ChatMember.
Added the ability to search for pinned messages in a chat with search_messages.
Added support for multiple pins and the ability to pin messages in private chats.
Pyrogram objects are now pickable (contributed by @GodSaveTheDoge in #526).
Added the method unpin_all_chat_messages to unpin all pinned messages in a chat.
Added support for the new football and slot machine animations for the random dice.
Added the new method get_media_group (contributed by @Legenda24 in #550).
Improved typing hints throughout the library (contributed by @alissonlauffer in #537).
Bugfixes & Enhancements¶
new_chat_photodownloadable (contributed by @GodSaveTheDoge #508).
filters.meto allow it intercept own anonymous messages (contributed by @M-Smits in #501).
Added a missing parameter in Message.reply_poll (contributed by @SpEcHiDe in #507) .
Skip empty messages when parsing dialogs (contributed by @JosXa in #555).
Added a nicer error in case of unknown constructors.
schedule_dateparameter to send_media_group.
Fixed idle() not working in windows.
Added some missing
Fixed media captions being displayed as “None” for inline media results when no caption was passed.
inputfor passwords and added the
hide_passwordparameter to Client.
sleep_thresholdparameter to the
Decreased the default sleep threshold from 60 to 10 seconds.
Fixed some “invalid escape” warnings.
sleep_threshold=0to always raise flood waits.
Fixed a bad f-string usage causing the text parser to break.
Fixed an issue causing inline callback queries to fail.
TLObjectas super class for base types.
Added the attribute
dc_idto Chat objects.
Fixed get_profile_photos not working properly in channels.
Added a warning to users in case they try to use base types as arguments.
Fixed dispatcher not obeying to the INFO logging level.
force_documentargument for send_document.
Fixed get_profile_photos not working correctly in case of no chat photos.
Fixed clock issues when running on AWS Lambda.
Fixed get_messages not working with list of ids in case the first message was empty.
Changed the default filter for
Fixed the raw API not being properly imported when using repr/eval.
Various improvements when using Pyrogram in a sync context.
Fixed sync callback progress not working properly for downloads.