Pyrogram v1.2#
Chat Event Log, Invite Links 2.0, Chat Member events and more#
New Features & Additions#
API schema updated to Layer 125.
Added a friendly interface for getting chat Event Logs (also known as recent admin actions):
Added the method get_chat_event_log to get the actions taken by chat members and administrators in the last 48h.
Added the types ChatEvent and ChatEventFilter.
Added support for the improved Invite Links (create, edit, revoke links; see admins’ links and who joined using your links).
Added the methods:
get_chat_invite_link - Get detailed information about a chat invite link.
create_chat_invite_link - Create an additional invite link for a chat.
edit_chat_invite_link - Edit a non-primary invite link.
revoke_chat_invite_link - Revoke a previously created invite link.
delete_chat_invite_link - Delete an already revoked invite link.
get_chat_invite_link_members - Get the members who joined the chat with the invite link.
get_chat_invite_link_members_count - Get the count of the members who joined the chat with the invite link.
get_chat_admin_invite_links - Get the invite links created by an administrator in a chat.
get_chat_admin_invite_links_count - Get the count of the invite links created by an administrator in a chat.
get_chat_admins_with_invite_links - Get the list of the administrators that have exported invite links in a chat.
delete_chat_admin_invite_links - Delete all revoked invite links of an administrator.
Added the types ChatInviteLink and ChatAdminWithInviteLinks.
Added support for Voice Chat service messages and information:
Added the type VoiceChatStarted, the field
voice_chat_started
to the class Message and the filter voice_chat_started.Added the type VoiceChatEnded, the field
voice_chat_ended
to the class Message and the filter voice_chat_ended.Added the type VoiceChatMembersInvited, the field
voice_chat_members_invited
to the class Message and the filter voice_chat_members_invited.Added the new administrator privilege
can_manage_voice_chats
to the class ChatMember and parametercan_manage_voice_chats
to the method promote_chat_member.
Added support for Chat Member status changes via dedicated events:
Added the new handler ChatMemberUpdatedHandler and its decorator on_chat_member_updated which will be used to listen for events represented by ChatMemberUpdated. The new event handler will listen for chat member status changes and will pass a
ChatMemberUpdated
object with the information about the previous and the new chat member status.
Added the bound method Message.get_media_group.
Added the new administrator privilege
can_manage_chat
to the class ChatMember and parametercan_manage_chat
to the method promote_chat_member.Added add_contact for adding an existing Telegram user as contact, even without a phone number. Renamed
add_contacts
to import_contacts.Added support for user mentions inside inline query results.
Added new information about voice calls.
About future user identifiers#
You might have heard that Telegram is approaching the upper limit of the signed 32-bit integer type used for user identifiers and that future identifiers will become bigger than 2^31 - 1
, and you were worried about it; there’s no reason to be alarmed as this will not be a problem for Pyrogram because Python uses arbitrary precision integers and the required changes underneath will be done transparently. The issue only arises in case you are storing yourself the identifiers in fixed 32-bit chunks; in that case you need to update your system to accommodate identifiers that can have up to 52 significant bits (meaning both a 64-bit integer and double-precision float type are safe to use).