Pyrogram v0.11.0#

Smart Plugins revamp and lots of additions#

What’s New#

  • Smart Plugins revamp: you can now specify exactly which plugins to include or exclude and in which exact order to load each of them.

  • no_updates Client parameter. Pass True in order to completely disable incoming updates from Telegram. Useful in batch programs, for example, when you want to broadcast a message to many users and have no need to handle incoming messages or other updates whatsoever.

  • takeout Client parameter. Pass True in order to use a special takeout session instead of a normal one. Useful for exporting your Telegram data; methods invoked inside a takeout session (such as get_history, download_media, …) are less prone to throw FloodWait exceptions.

  • Message and caption texts are now automatically casted to str. This makes possible to send objects that implement a string representation without having to manually cast, for example:

    • app.send_message(chat_id, 123456) sends “123456” (int) text message as string.

    • message.reply(message) replies with the message (Message) itself.

  • Filters.me, useful for filtering messages coming from you yourself. Does the same as Filters.user("me").

  • close_poll method for closing (stopping) polls.

  • New convenience methods to make iterating through entities such as history messages, dialogs and chat members easier: iter_history, iter_dialogs, iter_chat_members.

  • Game, GameHighScore and GameHighScores types for messages dealing with games, game and game_high_score attributes inside Message as well as Filters.game, Filters.game_score filters and send_game, set_game_score, get_game_high_scores methods.

  • It’s now possible to recover the account while logging in, in case you forget your cloud password.

  • Client’s arguments phone_number, password, first_name and last_name can now be callback functions.

  • Filters.regex now works on captions too.

  • New Filters.media_group for filtering photos or videos being part of an album.

  • New stop_transmission method useful to stop uploads and downloads.

  • New restart convenience method to automatically stop and start the Client.

  • The ChatMember type has been extended with extra attributes: date, inviter_by, promoted_by and restricted_by.

  • New Voice Calls page in documentation. Thanks to @bakatrouble for the working proof-of-concept.

  • A way to continue propagating the same update to the next handler within the same group with .continue_propagation() update’s bound-method.

  • A bunch of new common Telegram errors regarding takeout sessions and poll messages.

Bug Fixes#

  • Polls in Layer 91 were reporting a wrong id and in some cases they were also flagged as “closed” when they were in fact not. This is due to a small issue in the TL schema (which will eventually get fixed in the next Layer update by Telegram itself). Nevertheless, from now on Pyrogram will be able to generate the correct code even in case such issues happen again. Relevant commit: c7b1d6f70a97674fc59afc21b1334cd10f024b87

  • kick_chat_members and get_dialogs docstrings were reporting a wrong return type.

  • Handle develop installation for pip. Thanks @bakatrouble for the hint!

  • All raw updates that were not part of those for which a parser was implemented were being discarded and never passed to raw update handlers. #211

Breaking Changes#

  • get_history’s reversed parameter has been renamed to reverse because it was colliding with the built-in “reversed” function.