Pyrogram v0.13.0#
Welcome pyrogram.org#
This version features a massive overhaul of the documentation structure and a shiny new domain name: https://pyrogram.org. After well over a week spent working solely on the documentation website, here’s what’s new:
The documentation now lives at https://docs.pyrogram.org.
New style touches to make the overall website design more pleasant to look at.
New documentation sections: Introduction, Getting Started, API Reference, Topic Guides and Meta.
A Quickstart page to get new Pyrogrammers start as fast as possible.
Methods, Types and Bound Methods are kept in separate pages with lots of cross-references.
New FAQ, Glossary and Powered-by pages.
Lots of other additions and enhancements throughout existing pages to make them more detailed.
And finally, a page dedicated to all people who’d like to show their appreciation for my work :)
That’s all about the documentation, for now. I hope you enjoy it! Let’s now go ahead with listing the new features this version brings in the library itself:
New Features#
Added a PollHandler and an on_poll() decorator for handling Poll updates.
Added get_history_count() method.
Added get_dialogs_count() method.
Added get_contacts_count() method.
Added get_user_profile_photos_count() method.
New
bot
chat type. We now have “private”, “bot”, “group”, “supergroup” and “channel” Chat types.
Enhancements#
get_chat() method is now able to fetch the pinned message in your own chat (saved messages).
Increased media thumbnail size from 90px to 320px side length.
Added
is_member
attribute to the ChatMember type to check wether a restricted user is still a member of a chat.Added back the automatic mime type detection for new uploads.
Sending and receiving
callback_data
(with inline buttons and callback query respectively) has gained back support for strings. If you pass strings for which you are 100% sure they will be valid UTF-8 texts, you can rely on the library reporting back string types, otherwise you’ll get a bytes type. This is due to how Telegram handles callback queries data (only bytes allowed) and it’s a matter of convenience to allow strings as well.Added
supports_streaming
attribute to the Video type.Hint about which client is loading which plugins folder when you start them.
Added a
timeout
parameter to Message.click()Allowed Message.click() to be called without any argument for clicking the first button.
Bug Fixes#
Method delete_messages() and Message.delete() will now return
False
in case they fail to delete (they used to always return True due to how Telegram handles this method; the server doesn’t raise any error).get_messages() is now able to get more than one reply using the
replies
parameter. Up to unlimited replies.
Breaking Changes#
Method
close_poll()
was renamed to stop_poll().Attribute
forward_from_name
of Message was renamed toforward_sender_name
.Poll ids are now strings and not integers.
ParseMode
module was removed. It was pretty much useless, better just use “markdown” and “html” string literals.ChatAction
module was removed too, same reason ofParseMode
.Removed
get_chat_preview()
method, get_chat() will take care of both Chat and ChatPreview objects.