Release Notes#
This page lists all the documented changes of this fork, in reverse chronological order. You should read this when upgrading to this fork to know where your code can break, and where it can take advantage of new goodies!
For a more detailed description, please check the commits.
If you found any issue or have any suggestions, feel free to make an issue on github.
Breaking Changes in this Fork#
In
download_media()
, if the message is aPaidMediaInfo
with more than onepaid_media
andidx
was not specified, then a list of paths or binary file-like objects is returned.Make
get_messages()
accept only keyword-only arguments. 48d4230PR #115 This change breaks some usages with offset-naive and offset-aware datetimes.
PR from upstream: #1411 without attribution.
Changes in this Fork#
Scheme layer used: 198 |
Added the
cover
andstart_timestamp
parameters insend_video()
andInputPaidMediaVideo
.Added the
new_video_start_timestamp
and renamed thesend_copy
andremove_caption
parameters inforward_messages()
andforward()
.Added the
gift_count
to theChat
.Added the
get_similar_bots()
.Changed types in
UpgradedGift
,UserGift
.PR from upstream: 701
Scheme layer used: 196 |
Added the
get_owned_star_count()
and a possibly temporaryStarAmount
.Added the
UpgradedGift
and changed return typeget_available_gifts()
andget_user_gifts()
.Added the
pay_for_upgrade
in thesend_gift()
.Added the parameters
upgrade_star_count
andis_for_birthday
inGift
.Added the
on_bot_purchased_paid_media()
andon_bot_business_connection()
.Added the parameters
can_be_upgraded
,was_refunded
,prepaid_upgrade_star_count
,can_be_transferred
,transfer_star_count
,export_date
inUserGift
.Renamed the parameter
only_in_channels
tochat_type_filter
in thesearch_global_count()
andsearch_global()
.Removed
sender_user_id
parameter fromsell_gift()
andtoggle_gift_is_saved()
.
Scheme layer used: 195 |
Added the
get_owned_bots()
to return the list of owned by the current user bots.
Scheme layer used: 194 |
Added the field
schedule_date
and changed the return type of thesend_inline_bot_result()
.Added the field
subscription_expiration_date
in theSuccessfulPayment
.Added the parameter
subscription_period
in thecreate_invoice_link()
.
Scheme layer used: 192 |
Added
SHOW_MESSAGE_SENDER_ENABLED
,AGGRESSIVE_ANTI_SPAM_TOGGLED
,PROTECTED_CONTENT_TOGGLED
,CHAT_IS_FORUM_TOGGLED
,USERNAMES_CHANGED
,MEMBER_SUBSCRIPTION_EXTENDED
,MEMBER_JOINED_BY_LINK
,MEMBER_JOINED_BY_REQUEST
, and updatedChatEventFilter
with the corresponding attributes.Added the parameter
show_caption_above_media
to theedit_inline_caption()
.Added the parameter
allow_paid_broadcast
to the methodscopy_media_group()
,send_game()
,send_invoice()
,forward_messages()
,send_animation()
,send_audio()
,send_cached_media()
,send_contact()
,send_dice()
,send_document()
,send_location()
,send_media_group()
,send_message()
,send_paid_media()
,send_photo()
,send_poll()
,send_sticker()
,send_venue()
,send_video_note()
,send_video()
,send_voice()
and the bound methodsreply_game()
,reply_text()
,reply_animation()
,reply_audio()
,reply_contact()
,reply_document()
,reply_location()
,reply_media_group()
,reply_photo()
,reply_poll()
,reply_sticker()
,reply_venue()
,reply_video()
,reply_video_note()
,reply_voice()
,reply_invoice()
,forward()
,copy()
,reply_cached_media()
.Introduced the ability to add media to existing text messages using the method
edit_message_media()
,edit_cached_media()
,edit_media()
,edit_cached_media()
.Added the class
CopyTextButton
and the fieldcopy_text
in the classInlineKeyboardButton
allowing bots to send and receive inline buttons that copy arbitrary text.
Scheme layer used: 190 |
Added the methods
get_available_gifts()
,get_user_gifts()
,sell_gift()
,send_gift()
,toggle_gift_is_saved()
,toggle()
and the typesUserGift
andGift
.Added the parameter
send_as
in the appropriate methods and bound methods PR 107.
Scheme layer used: 189 |
Added
toggle_forum_topic_is_pinned()
to pin / unpin aForumTopic
.Added the field
alternative_videos
to theMessage
.Added the fields
connected_website
andwrite_access_allowed
to theMessage
.Fix
chat
being None in some cases in theMessage
.Fix deleting messages does not return the count in some cases.
Scheme layer used: 187 |
Added the parameter
emoji
insend_sticker()
andreply_sticker()
. #86.Return list of photos and videos instead of bool in send_payment_form.
Added the field
prize_star_count
to the classesGiveawayCreated
,Giveaway
,GiveawayWinners
.Added the field
is_star_giveaway
to the classGiveawayCompleted
.Added the ability to specify a payload in
send_paid_media()
that is unused currently.
Scheme layer used: 186 |
Try to return the service message (when applicable) in the methods
set_chat_photo()
,set_photo()
.Added the methods
get_payment_form()
andsend_payment_form()
#89.Added the fields
expired_member_count
,subscription_period
andsubscription_price
to the classChatInviteLink
.Added the field
can_enable_paid_reaction
to the classChat
.Added
link
property toStory
and fixed thelink
property inMessage
.Introduced
DraftMessage
type.Added the ability to send paid media to any chat and the parameter
business_connection_id
to thesend_paid_media()
, allowing bots to send paid media on behalf of a business account.Added the field
until_date
to the classChatMember
for members with an active subscription.Added
add_paid_message_reaction()
andReactionTypePaid
Updated errors list and improved documentation of some of the methods.
Added missing parameters to
get_dialogs()
andDialog
.Added a
ChatJoinType
to distinguish the different types ofNEW_CHAT_MEMBERS
.Added
CONTACT_REGISTERED
andSCREENSHOT_TAKEN
types of service messages.View new and changed raw API methods.
Scheme layer used: 185 |
Added the parameter
chat_list
to the methodsget_dialogs()
andget_dialogs_count()
.Added
gifted_stars
service message to the classMessage
.Added the fields
have_access
,has_main_web_app
,active_user_count
to the classUser
, which is returned in response toget_me()
.Added the parameter
business_connection_id
to the methodspin_chat_message()
andunpin_chat_message()
, allowing bots to manage pinned messages on behalf of a business account.
Scheme layer used: 184 |
Updated
via_bot
, to optionally support filtering invalid botuser_id
.Added the
get_active_sessions()
,terminate_session()
,terminate()
, andterminate_all_other_sessions()
.Added the
is_automatic_forward
to theMessage
.Added the parameters
offset_id
to thesearch_messages()
and the parametersmin_date
,max_date
,min_id
,max_id
,saved_messages_topic_id
to thesearch_messages_count()
.Dynamic session ReStart + restart optimizations (#56)
Added the
delete_account()
,transfer_chat_ownership()
,update_status()
(#49, #51)Added the class
RefundedPayment
, containing information about a refunded payment.Added the field
refunded_payment
to the classMessage
, describing a service message about a refunded payment.
Scheme layer used: 183 |
Added the classes
PaidMedia
,PaidMediaInfo
,PaidMediaPreview
,PaidMediaPhoto
andPaidMediaVideo
, containing information about paid media.Added the method
send_paid_media()
and the classesInputPaidMedia
,InputPaidMediaPhoto
andInputPaidMediaVideo
, to support sending paid media.Added the field
paid_media
to the classesMessage
andExternalReplyInfo
.Added
get_stories()
.Added filters
thread
andself_destruct
.Added the field
can_send_paid_media
to the classChat
.Added support for launching Web Apps via
t.me
link in the classMenuButtonWebApp
.
Scheme layer used: 182 |
Updated the parameter
business_connection_id
to the methodsedit_text()
,edit_media()
,edit_reply_markup()
,edit_message_text()
,edit_message_media()
,edit_message_reply_markup()
.Added the parameter
business_connection_id
to the methodsedit_message_text()
,edit_message_media()
,edit_cached_media()
,edit_message_caption()
andedit_message_reply_markup()
, allowing the bot to edit business messages.Added the parameter
business_connection_id
to the methodstop_poll()
, allowing the bot to stop polls it sent on behalf of a business account.Added support for callback queries originating from a message sent on behalf of a business account.
Scheme layer used: 181 |
Added the classes
InputLocationMessageContent
,InputVenueMessageContent
,InputContactMessageContent
,InputInvoiceMessageContent
.`Added the methods
translate_text()
,translate_message_text()
,translate()
and the typeTranslatedText
(#39).Added the methods
create_video_chat()
,discard_group_call()
,get_video_chat_rtmp_url()
and the typeRtmpUrl
(#37).Added
on_story()
to listen to story updates.Ability to run in replit environment without creating a deployment. Set the environment variable
PYROGRAM_REPLIT_NWTRAFIK_PORT
value to5222
if you want to connect to Production Telegram Servers, OR Set the environment variablePYROGRAM_REPLIT_WNTRAFIK_PORT
value to5223
if you want to connect to Test Telegram Servers, before starting theClient
.Added the
invite_group_call_participants()
(#35).Added the types
LabeledPrice
,OrderInfo
,PreCheckoutQuery
,ShippingAddress
,ShippingOption
,ShippingQuery
andSuccessfulPayment
.Added the
successful_payment
parameter to theMessage
. Added the filtersuccessful_payment
to detect service messages of Successful Payment type.Added the methods
send_invoice()
,answer_pre_checkout_query()
(answer()
),answer_shipping_query()
(answer()
),refund_star_payment()
andcreate_invoice_link()
.Added the
send_web_app_custom_request()
.Added the
search_public_messages_by_tag()
andcount_public_messages_by_tag()
.Added the
fetch_replies
parameter toClient
.Added the
get_message_effects()
.Added the parameter
message_effect_id
to the methodssend_message()
,send_photo()
,send_video()
,send_animation()
,send_audio()
,send_document()
,send_sticker()
,send_video_note()
,send_voice()
,send_location()
,send_venue()
,send_contact()
,send_poll()
,send_dice()
,send_game()
, andsend_media_group()
, and the correspondingreply_*
methods in the classMessage
.Added the field
effect_id
to the classMessage
.Added the field
show_caption_above_media
to the classesMessage
,InputMediaAnimation
,InputMediaPhoto
,InputMediaVideo
,InlineQueryResultAnimation
,InlineQueryResultCachedAnimation
,InlineQueryResultPhoto
,InlineQueryResultCachedPhoto
,InlineQueryResultVideo
,InlineQueryResultCachedVideo
,send_cached_media()
,send_animation()
,send_photo()
,send_video()
,copy_message()
andedit_message_caption()
, and the correspondingreply_*
methods.Added support for
EXPANDABLE_BLOCKQUOTE
entities in received messages.Added support for
EXPANDABLE_BLOCKQUOTE
entity parsing inHTML
parse mode.Allowed to explicitly specify
EXPANDABLE_BLOCKQUOTE
entities in formatted texts.
Scheme layer used: 179 |
Add
invoice
toMessage
andExternalReplyInfo
.Add
link_preview_options
toClient
.Support for the updated Channel ID format. #28
Improvements to
save_file()
andget_file()
to handle the new FLOOD_PREMIUM_WAIT errors.Added
has_animation
,is_personal
,minithumbnail
parameters toChatPhoto
.Changed return type of
get_chat_photos()
to returnPhoto
orAnimation
.Added
get_chat_sponsored_messages()
and the typeSponsoredMessage
, by stealing unauthored changes from KurimuzonAkuma/pyrogram#55.Added
load_group_call_participants()
and the typeGroupCallParticipant
, by stealing unauthored changes from 6df467f.Added
view_messages()
and the bound methodsread()
andview()
.Added the field
question_entities
to the classPoll
.Added the field
text_entities
to the classPollOption
.Added the parameters
question_parse_mode
andquestion_entities
to the methodsend_poll()
.Added the class
InputPollOption
and changed the type of the parameteroptions
in the methodsend_poll()
to Array ofInputPollOption
.Added the field
max_reaction_count
to the classChat
.Added the field
via_join_request
to the classChatMemberUpdated
.Added the class
TextQuote
and the fieldquote
of typeTextQuote
to the classMessage
, which contains the part of the replied message text or caption that is quoted in the current message.Added
revoke_messages
parameter toban_chat_member()
andban_member()
.Added
get_collectible_item_info()
.Added
reverse
parameter toget_chat_history()
. (855e69e, a086b49)
Scheme layer used: 178 |
Added
search_chats()
.Added
get_bot_name()
,get_bot_info_description()
,get_bot_info_short_description()
,set_bot_name()
,set_bot_info_description()
,set_bot_info_short_description()
.Added
edit_cached_media()
andedit_cached_media()
.Steal d51eef3 without attribution.
Added
max_reaction_count
toChatReactions
.Added
personal_chat_message
toChat
.Added
only_in_channels
parameter tosearch_global()
andsearch_global_count()
.
Scheme layer used: 177 |
Added
emoji_message_interaction
parameter tosend_chat_action()
andreply_chat_action()
.BOTS ONLY: Updated
ChatMemberUpdatedHandler
to handle updates when the bot is blocked or unblocked by a user.Added missing parameters in
create_group()
,create_supergroup()
,create_channel()
.Try to return the service message (when applicable) in the methods
add_chat_members()
,promote_chat_member()
Add
TRIGGER_EMOJI_ANIMATION
andWATCH_EMOJI_ANIMATION
insend_chat_action()
andreply_chat_action()
.Attempted to revert the Backward Incompatible changes in the commits fb118f95d and 848bc8644.
Added
callback_data_with_password
toInlineKeyboardButton
and added support inclick()
for such buttons.PR from upstream: 1391 without attribution.
Added
gifted_premium
service message toMessage
.Added
get_stickers()
.Added
filters.users_shared
andfilters.chat_shared
.Added the field
origin
of typeMessageOrigin
in the classExternalReplyInfo
.Added the class
MessageOrigin
and replaced the fieldsforward_from
,forward_from_chat
,forward_from_message_id
,forward_signature
,forward_sender_name
, andforward_date
with the fieldforward_origin
of typeMessageOrigin
in the classMessage
.Added
accent_color
,profile_color
,emoji_status
,is_close_friend
toChat
andUser
.Added the method
get_created_chats()
.Added the class
ForumTopic
and the methodsget_forum_topics()
,get_forum_topic()
.Install the version, from PyPI, using
pip uninstall -y pyrogram && pip install pyrotgfork==2.1.17
.Added the classes
BusinessOpeningHours
andBusinessOpeningHoursInterval
and the fieldbusiness_opening_hours
to the classChat
.Added the class
BusinessLocation
and the fieldbusiness_location
to the classChat
.Added the class
BusinessIntro
and the fieldbusiness_intro
to the classChat
.Added the parameter
business_connection_id
to the methodssend_message()
,send_photo()
,send_video()
,send_animation()
,send_audio()
,send_document()
,send_sticker()
,send_video_note()
,send_voice()
,send_location()
,send_venue()
,send_contact()
,send_poll()
,send_game()
,send_media_group()
,send_dice()
,send_chat_action()
,send_cached_media()
andcopy_message()
and the corresponding reply_* methods.Added
get_business_connection()
.Added
BusinessConnection
.Added support for
https://t.me/m/blah
links in thelink
parameter ofget_messages()
Added the parameter
message_thread_id
to thesearch_messages()
andsearch_messages_count()
.Added the parameter
chat_list
tosearch_global()
andsearch_global_count()
.BOTS ONLY: Handled the parameter
business_connection_id
to the update handlersMessageHandler
,EditedMessageHandler
,DeletedMessagesHandler
.Added the field
business_connection_id
to the classMessage
.Bug fix for the
users_shared
,chat_shared
logic inMessage
.Added
set_birthdate()
andset_personal_chat()
, for user accounts only.Added the field
birthdate
to the classChat
.Added the field
is_from_offline
to the classMessage
.Added the field
sender_business_bot
to the classMessage
.Added the fields
users_shared
,chat_shared
to the classMessage
.Added the field
personal_chat
to the classChat
.Added the field
can_connect_to_business
to the classUser
.Rearrange
send_sticker()
parameter names.Added the fields
request_title
,request_username
, andrequest_photo
to the classKeyboardButtonRequestChat
.Added the fields
request_name
,request_username
, andrequest_photo
to the classKeyboardButtonRequestUsers
.
Scheme layer used: 176 |
Add
message_thread_id
parameter tounpin_all_chat_messages()
.Add
create_forum_topic()
,edit_forum_topic()
,close_forum_topic()
,reopen_forum_topic()
,hide_forum_topic()
,unhide_forum_topic()
,delete_forum_topic()
,get_forum_topic_icon_stickers()
.- Add
AioSQLiteStorage
, by stealing the following commits:
- Add
Add
public
,for_my_bot
todelete_profile_photos()
.Make
photo_ids
parameter as optional indelete_profile_photos()
.Add
supergroup_chat_created
toMessage
.Add
forum_topic_created
,forum_topic_closed
,forum_topic_edited
,forum_topic_reopened
,general_forum_topic_hidden
,general_forum_topic_unhidden
toMessage
.Add
custom_action
toMessage
.Add
public
,for_my_bot
,photo_frame_start_timestamp
toset_profile_photo()
.Add
inline_need_location
,can_be_edited
toUser
.Add
giveaway
,giveaway_created
,giveaway_completed
andgiveaway_winners
inMessage
andExternalReplyInfo
.Bug fix for
send_message()
with themessage_thread_id
parameter.Added
request_users
andrequest_chat
toKeyboardButton
.- NOTE: using the
scheduled
parameter, please be aware about using the correct Message Identifiers. Add
is_scheduled
parameter todelete_messages()
.Add
schedule_date
parameter toedit_message_caption()
,edit_message_media()
,edit_message_text()
.Added
is_scheduled
toget_messages()
.Added
is_scheduled
toget_chat_history()
.
- NOTE: using the
Added new parameter
client_platform
toClient
.PR from upstream: 1403.
Added
story
toExternalReplyInfo
.Added
story_id
toReplyParameters
.Added support for clicking (
WebAppInfo
,LoginUrl
,user_id
,switch_inline_query_chosen_chat
) buttons inclick()
.Rewrote
download_media()
to support Story, and also made it future proof.
PmOItrOAe |
Renamed
placeholder
toinput_field_placeholder
inForceReply
andReplyKeyboardMarkup
.Add
link
parameter inget_messages()
Documentation Builder Fixes
faster-pyrogram is not polished or documented for anyone else’s use. We don’t have the capacity to support faster-pyrogram as an independent open-source project, nor any desire for it to become an alternative to Pyrogram. Our goal in making this code available is a unified faster Pyrogram. …
Leaked Scheme Layers (2) |
Removed
ChatPreview
class, and merged the parameters with theChat
class.Added
description
,accent_color_id
,is_verified
,is_scam
,is_fake
,is_public
,join_by_request
attributes to the classChatPreview
.Added
force_full
parameter toget_chat()
.Bug Fix for
get_chat()
andjoin_chat()
whenhttps://t.me/username
was passed.Added missing attributes to the class
Story
when it is available.Added the field
reply_to_story
to the classMessage
.Added the field
user_chat_id
to the classChatJoinRequest
.Added the field
switch_inline_query_chosen_chat
of the typeSwitchInlineQueryChosenChat
to the classInlineKeyboardButton
, which allows bots to switch to inline mode in a chosen chat of the given type.Add support for
pay
inInlineKeyboardButton
Revert e678c05 and stole squashed unauthored changes from bcd18d5
Scheme layer used: 174 |
Added the field
story
to the classMessage
for messages with forwarded stories. Currently, it holds no information.Added the class
ChatBoostAdded
and the fieldboost_added
to the classMessage
for service messages about a user boosting a chat.Added the field
custom_emoji_sticker_set_name
to the classChat
.Added the field
unrestrict_boost_count
to the classChat
.Added the field
sender_boost_count
to the classMessage
.
Scheme layer used: 173 |
Fix ConnectionResetError when only ping task (#24)
Added
is_topic_message
to theMessage
object.Added
has_visible_history
,has_hidden_members
,has_aggressive_anti_spam_enabled
,message_auto_delete_time
,slow_mode_delay
,slowmode_next_send_date
,is_forum
to theChat
object.Added
add_to_recent
,story_id
parameters inset_reaction()
.Bug fix in parsing
Vector<Bool>
(Thanks to @AmarnathCJD and @roj1512).Documentation Fix of
max_concurrent_transmissions
type hint.Bug Fix in the
get_file
method. (Thanks to @ALiwoto).Added missing attributes to
ChatPermissions
andChatPrivileges
.Added new parameter
no_joined_notifications
toClient
.Fix history TTL Service Message Parse.
Thanks to …. If you want to change the location of the
unknown_errors.txt
file that is created byClient
, set the environment variablePYROGRAM_LOG_UNKNOWN_ERRORS_FILENAME
value to the path where the file should get created.Renamed
force_document
todisable_content_type_detection
insend_document()
andreply_document()
.Added missing attributes
added_to_attachment_menu
,can_be_added_to_attachment_menu
,can_join_groups
,can_read_all_group_messages
,supports_inline_queries
,restricts_new_chats
to theUser
.Migrate project to
pyproject.toml
fromsetup.py
.PRs from upstream: 1366, 1305, 1288, 1262, 1253, 1234, 1210, 1201, 1197, 1143, 1059.
Bug fix for
send_audio()
andsend_voice()
. (Thanks to …).Add waveform parameter to
send_voice()
.Added view_once parameter to
send_photo()
,send_video()
,send_video_note()
,send_voice()
.Add missing parameters to
reply_photo()
,reply_video()
,reply_video_note()
,reply_voice()
.
Scheme layer used: 170 |
Stole documentation from PyrogramMod.
Renamed
send_reaction
toset_reaction()
.Added support for
send_photo()
,send_video()
,send_animation()
,send_voice()
messages that could be played once.Added the field
via_chat_folder_invite_link
to the classChatMemberUpdated
.BOTS ONLY: Added updates about a reaction change on a message with non-anonymous reactions, represented by the class
MessageReactionUpdatedHandler
and the fieldmessage_reaction
in the class Update.BOTS ONLY: Added updates about reaction changes on a message with anonymous reactions, represented by the class
MessageReactionCountUpdatedHandler
and the fieldmessage_reaction_count
in the class Update.Replaced the parameter
disable_web_page_preview
withLinkPreviewOptions
in the methodssend_message()
andedit_message_text()
.Replaced the field
disable_web_page_preview
withLinkPreviewOptions
in the classInputTextMessageContent
.Added missing parameters to
forward_messages()
.Added the class
ReplyParameters
and replaced parametersreply_to_message_id
in the methodscopy_message()
,send_message()
,send_photo()
,send_video()
,send_animation()
,send_audio()
,send_document()
,send_sticker()
,send_video_note()
,send_voice()
,send_location()
,send_venue()
,send_contact()
,send_poll()
,send_dice()
,send_game()
,send_media_group()
,copy_media_group()
,send_inline_bot_result()
,send_cached_media()
, and the corresponding reply_* methods with the fieldreply_parameters
of typeReplyParameters
.Bug fixes for sending
ttl_seconds
andhas_spoiler
.
Scheme layer used: 169 |
Changed condition in
join_chat()
andget_chat()
.Added
disable_content_type_detection
parameter toInputMediaVideo
.Added
has_spoiler
parameter tocopy_message()
.Improved
get_chat_history()
: addmin_id
andmax_id
params.Fix downloading media to
WORKDIR
whenWORKDIR
was not specified.Documentation fix for
user.mention
inUser
.
Scheme layer used: 167 |
Fixed the TL flags being Python reserved keywords:
from
andself
.
Scheme layer used: 161 |
Added
my_stories_from
to theblock_user()
andunblock_user()
methods.
Scheme layer used: 160 |
Added
message_thread_id
to the methodscopy_message()
,forward_messages()
,send_message()
,send_photo()
,send_video()
,send_animation()
,send_audio()
,send_document()
,send_sticker()
,send_video_note()
,send_voice()
,send_location()
,send_venue()
,send_contact()
,send_poll()
,send_dice()
,send_game()
,send_media_group()
,copy_media_group()
,send_inline_bot_result()
,send_cached_media()
.