Pyrogram v0.18.0#

Layer 116 and lots of goodies#

New Features & Enhancements#

  • Updated the API schema to Layer 116.

  • Added support for uploads up to 2000 MiB in size to both user and bot identities.

  • Added support for in-memory uploads. You can now pass a BytesIO object when uploading a file that lives in-memory; make sure to set the object’s .name attribute to a file name before using it, e.g.: b = BytesIO(...); b.name = "filename.zip" (contributed by @OctoNezd in #261).

  • Added support for profile videos. Pass a video file to set_profile_photo or set_chat_photo to update your profile picture using a video.

  • Added an automatic sleep mechanism for flood wait exceptions. Use Client’s sleep_threshold parameter to set a sleep threshold for flood wait exceptions happening globally in a client instance, below which any request that raises a flood wait will be automatically invoked again after sleeping for the required amount of time. Flood wait exceptions requiring higher waiting times will be raised.

  • Added linked_chat to Chat objects. Useful to get the the linked discussion group (in case of channels) or the linked channel (in case of supergroups).

  • Added support for joining linked chats with the Chat.join bound method.

  • Filters.regex has been granted superpowers and can now be applied to handlers that receive Message, CallbackQuery or InlineQuery (previously it was only working for Message updates). This made Filters.callback_data obsolete which has been removed.

  • Added support for basketball and football animation of the random dice. Choose between different animations (dice, darts, basketball, football) by specifying the emoji parameter in the method send_dice.

  • Added search_global method for searching messages globally from all of your chats.

  • CallbackQuery.answer optional arguments are now actually optional in code.

  • Added the session name in log lines (contributed by @CrisMystik in #401).

  • Added Filters.linked_channel to filter messages coming from the channel connected to the chat.

  • Added file_name to file-related functions (contributed by @demget in #308 and @saidgadjiev in #440).

  • Logs in DEBUG level will now show more relevant information about what is being sent and received.

  • Updated the Bot API diagram in the documentation (minor graphical issues).

  • No need to add via_bot from Bot API v4.9 because Pyrogram already has it since long time ago.

  • Added a Message.link attribute to obtain the message link in form of a URL (contributed by @ColinTheShark in #442).

  • Extended set_slow_mode to accept None as argument for disabling the slow mode.

  • Added parse_mode parameter to Client. Set your desired parse_mode when creating a client instance (contributed by @mendelmaleh in #443).

  • send_document will now send actual documents, even when uploading a video file.

  • Updated instructions for accessing test servers in tdesktop.

  • Minor fixes and cleanups (also contributed by @alissonlauffer in #439).

Bug Fixes#

  • Fixed docs about update_profile (contributed by @CyanBook in #395).

  • Fixed an issue in which messages sent with entities at the end of the text would result in messages without entities.

  • Fixed some small typos in the documentation.

Breaking Changes#

  • Filters.callback_data has been removed in favor of Filters.regex.