Further expanding Pyrogram’s API#
Telegram API scheme has been updated to Layer 81.
Pyrogram will now display Telegram’s terms of service when you sign-in (only if not previously accepted) and will automatically accept them as soon as you successfully authorize yourself.
The new DeletedMessagesHandler allows you to listen for deleted messages on private chats, groups and channels (contributed by @vitalibr in #91).
Use the new DisconnectHandler to register a function that will be called in case of disconnections.
The new request_callback_answer() method lets you get the answer of a callback query (this is more widely known as clicking an inline button on a bot message).
The Message type receives four new convenience bound methods: reply(), forward(), delete() and click(). You can use them as shortcut methods instead of send_message(), forward_messages(), delete_messages() and request_callback_answer().
Filters.command() can now accept both empty and multi-character prefixes. It’s now also possible to make case-sensitive commands with
Two new filters: Filters.reply_keyboard and Filters.inline_keyboard to filter basic and inline keyboards respectively.
Use the new run() method to automatically start and idle a client. This is a simple convenience method, for more control over your Clients you can still use start(), idle() and stop().
Four new methods for chat administration have been added: kick_chat_member(), unban_chat_member(), restrict_chat_member, promote_chat_member().
You can now customize your Clients by setting
lang_codefor a finer grained control over what you want to be displayed in your session detailed info and what language you want Telegram to speak you in.
The phone_code_callback function must now accept a single positional argument (phone_number).
Notable Bug Fixes#
2944181b388aa687cf7af7083c888e574fafb248 Fixes an issue where the newly created session used for uploading was never used (contributed by @YoilyL in #85).
5b300ef83cdbd5cc088abe694d46dc33b4d0189e Fixes a rare bug where GIFs weren’t handled because of missing dimension attributes.
28310cb0a74b5dc13c7e05a8bfea6bff62475033 Fixes GIFs not being recognized when using Filters.media.