Pyrogram v1.3#
Docs Dark mode, Reactions, Spoiler Texts and more#
Security Update#
A team of cryptographers at ETH Zürich (Switzerland) [1] has performed a security analysis of Pyrogram’s implementation of the MTProto 2.0 protocol, which resulted in a discovery of a vulnerability. More in details: the implementation was missing some checks listed here. The vulnerability has been promptly patched within the usual industry practice of a 90-day disclosure period. All users are strongly encouraged to update to the latest version of Pyrogram.
New Features & Additions#
Added Dark Mode to the documentation. You can switch between Light, Dark and Auto themes on the fly.
Added support for message reactions. Added the type
Reaction
, the methodsend_reaction()
and fieldsChat.available_reactions
andMessage.reactions
.Added support for spoiler text via markdown
||text||
and HTML<spoiler>text</spoiler>
.Added support for protected content messages. Added the parameter
protect_content
to all applicablesend_*
methods.Added support for channel comments via the new method
get_discussion_message()
. Get the discussion message from the linked discussion group of a channel post and reply to it to leave a comment.Added support for “send_as” chats. You can send messages in groups on behalf of another channel. Added the methods
get_send_as_chats()
andset_send_as_chat()
. Added the fieldsend_as_chat
to theChat
type.Added support for bot commands with trailing usernames. Now
filters.command("start")
will recognise both/start
and/start@usernamebot
commands.Added the field
chat_type
to the typeInlineQuery
.Added
VoiceChatScheduled
type andMessage.voice_chat_scheduled
field.Message.media
andMessage.service
are now strings and contain the name of the media or service message instead of a boolean value. This way you can tell which media or service message is by looking at the attribute.Added the new methods
copy_media_group()
,set_bot_commands()
,search_messages_count()
andsearch_global_count()
.Added the new types
InlineQueryResultAudio
andInlineQueryResultVideo
.Added support for in-memory uploads in
send_media_group()
.Added support for mentioning users by their ID in inline keyboards via the new
user_id
argument.Added the field
has_protected_content
to the typesChat
andMessage
.Added the the parameter
creates_join_request
to the methodscreate_chat_invite_link()
andedit_chat_invite_link()
for managing chat invite links that create join requests.Added the fields
creates_join_request
andpending_join_request_count
to the typeChatInviteLink
.Added the field
name
to the typeChatInviteLink
and the parametersname
to the methodscreate_chat_invite_link()
andedit_chat_invite_link()
for managing invite link names.Added event handlers about new requests to join a chat. Added
ChatJoinRequest
,ChatJoinRequestHandler
andon_chat_join_request
.Added the methods
set_chat_protected_content()
and the respectiveChat
bound method.Added support for the choose_sticker and import_history action in the method
send_chat_action()
.Added the methods
approve_chat_join_request()
anddecline_chat_join_request()
for managing requests to join the chat.
Other changes#
Chat permissions are now the same as the ones seen in official clients. This means you cannot set sticker, gif, game and inline bot permission singularly anymore, but they all fall under the
can_send_other_messages
permission.All “kick(ed)” occurrences have been replaced by “ban(ned)”. This means the method
kick_chat_member
has been renamed toban_chat_member()
and the “kicked” filter to be used inget_chat_members()
has been renamed to “banned”.