Pyrogram v0.12.0#

Welcome Inline Mode, Layer 97 and many other additions#

New Features#

Enhancements#

  • Added Python __slots__ in every single type to help reduce the memory footprint.

  • The send_media_group() method will now return a Messages object.

  • Added a retry mechanism when uploading file chunks.

  • The get_contacts() method will now return a list of User objects.

  • Embedded an updated version of typing.py as an attempt to fix Python 3.5.0-3.5.2 issues.

  • All send_* methods dealing with media messages (audio, document, animation, etc…) will now always send the correct Telegram media kind, regardless of the uploaded file.

  • Keyboard buttons’ texts are now automatically coerced to str.

  • The join_chat() method will now return a Chat object (contributed by @bakatrouble in #206).

  • Use a lower timeout when starting a session to speed up re-connections.

  • Updated the restrict_chat_member() method with new permissions and made it return a Chat object.

  • Printed object (e.g.: when using print(message)) will now display UTF-8 characters instead of ASCII representations of their code points.

  • You can now forward messages as copy with the new as_copy parameter in forward_messages() method and Message.forward() bound method (contributed by @bakatrouble in #227 ).

  • Added support for forwarded messages with hidden users; the new forward_from_name attribute of a Message will contain the user first name only (as string) of the author as opposed to a full User object.

Bug Fixes#

  • Fixed a loss of thumbnails after editing media messages (contributed by @23rd in #216).

  • Fixed plugins not working under Windows because of broken paths (contributed by @bakatrouble in #223).

  • Fixed “ModuleNotFoundError is not defined” error for Python <3.6.

  • Fixed the get_chat_member() method not working when passing “me” in basic groups.

  • Fixed flood wait errors generated when iterating over basic chat members.

  • Fixed library not loading for Python 3.5.0-3.5.2 (contributed by @Bfaschat in #236).

  • Fixed set_chat_description() not working anymore after the new Layer update.

Breaking Changes#

  • When using raw functions and types, you now must fill in the parameters using named arguments.

  • The errors package has been moved; it is now importable with from pyrogram import errors, and the Error exception has been renamed to RPCError.