From 20d36a2ab8a21eeff2f360f73b14b99d5e397762 Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Tue, 15 Apr 2025 23:06:42 +0300 Subject: [PATCH] Update changelog --- CHANGES.rst | 173 +++++++++++++++++++++++++++++++++++++++ CHANGES/1657.feature.rst | 1 - CHANGES/1658.bugfix.rst | 6 -- CHANGES/1659.misc.rst | 2 - CHANGES/1661.misc.rst | 1 - CHANGES/1664.bugfix.rst | 25 ------ CHANGES/1666.doc.rst | 1 - CHANGES/1671.feature.rst | 107 ------------------------ 8 files changed, 173 insertions(+), 143 deletions(-) delete mode 100644 CHANGES/1657.feature.rst delete mode 100644 CHANGES/1658.bugfix.rst delete mode 100644 CHANGES/1659.misc.rst delete mode 100644 CHANGES/1661.misc.rst delete mode 100644 CHANGES/1664.bugfix.rst delete mode 100644 CHANGES/1666.doc.rst delete mode 100644 CHANGES/1671.feature.rst diff --git a/CHANGES.rst b/CHANGES.rst index 3377d2c3..394bfacd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -16,6 +16,179 @@ Changelog .. towncrier release notes start +3.20.0 (2025-04-14) +==================== + +Features +-------- + +- Add different shortcut methods for ``aiogram.utils.formatting.Text.as_kwargs()`` + `#1657 `_ +- Added full support for the `Bot API 9.0 `_: + + **Business Accounts** + + - Added the class :class:`aiogram.types.business_bot_rights.BusinessBotRights` and replaced + the field :code:`can_reply` with the field :code:`rights` of the type + :class:`aiogram.types.business_bot_rights.BusinessBotRights` in the class + :class:`aiogram.types.business_connection.BusinessConnection`. + - Added the method :class:`aiogram.methods.read_business_message.ReadBusinessMessage`, + allowing bots to mark incoming messages as read on behalf of a business account. + - Added the method :class:`aiogram.methods.delete_business_messages.DeleteBusinessMessages`, + allowing bots to delete messages on behalf of a business account. + - Added the method :class:`aiogram.methods.set_business_account_name.SetBusinessAccountName`, + allowing bots to change the first and last name of a managed business account. + - Added the method :class:`aiogram.methods.set_business_account_username.SetBusinessAccountUsername`, + allowing bots to change the username of a managed business account. + - Added the method :class:`aiogram.methods.set_business_account_bio.SetBusinessAccountBio`, + allowing bots to change the bio of a managed business account. + - Added the class :class:`aiogram.types.input_profile_photo.InputProfilePhoto`, + describing a profile photo to be set. + - Added the methods :class:`aiogram.methods.set_business_account_profile_photo.SetBusinessAccountProfilePhoto` + and :class:`aiogram.methods.remove_business_account_profile_photo.RemoveBusinessAccountProfilePhoto`, + allowing bots to change the profile photo of a managed business account. + - Added the method :class:`aiogram.methods.set_business_account_gift_settings.SetBusinessAccountGiftSettings`, + allowing bots to change the privacy settings pertaining to incoming gifts in a managed business account. + - Added the class :class:`aiogram.types.star_amount.StarAmount` and the method + :class:`aiogram.methods.get_business_account_star_balance.GetBusinessAccountStarBalance`, + allowing bots to check the current Telegram Star balance of a managed business account. + - Added the method :class:`aiogram.methods.transfer_business_account_stars.TransferBusinessAccountStars`, + allowing bots to transfer Telegram Stars from the balance of a managed business account to their own balance + for withdrawal. + - Added the classes :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular`, + :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique`, :class:`aiogram.types.owned_gifts.OwnedGifts` + and the method :class:`aiogram.methods.get_business_account_gifts.GetBusinessAccountGifts`, + allowing bots to fetch the list of gifts owned by a managed business account. + - Added the method :class:`aiogram.methods.convert_gift_to_stars.ConvertGiftToStars`, + allowing bots to convert gifts received by a managed business account to Telegram Stars. + - Added the method :class:`aiogram.methods.upgrade_gift.UpgradeGift`, + allowing bots to upgrade regular gifts received by a managed business account to unique gifts. + - Added the method :class:`aiogram.methods.transfer_gift.TransferGift`, + allowing bots to transfer unique gifts owned by a managed business account. + - Added the classes :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto` + and :class:`aiogram.types.input_story_content_video.InputStoryContentVideo` + representing the content of a story to post. + - Added the classes :class:`aiogram.types.story_area.StoryArea`, + :class:`aiogram.types.story_area_position.StoryAreaPosition`, + :class:`aiogram.types.location_address.LocationAddress`, + :class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation`, + :class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction`, + :class:`aiogram.types.story_area_type_link.StoryAreaTypeLink`, + :class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather` + and :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift`, + describing clickable active areas on stories. + - Added the methods :class:`aiogram.methods.post_story.PostStory`, + :class:`aiogram.methods.edit_story.EditStory` + and :class:`aiogram.methods.delete_story.DeleteStory`, + allowing bots to post, edit and delete stories on behalf of a managed business account. + + **Mini Apps** + + - Added the field :code:`DeviceStorage`, allowing Mini Apps to use persistent + local storage on the user's device. + - Added the field :code:`SecureStorage`, allowing Mini Apps to use a secure local + storage on the user's device for sensitive data. + + **Gifts** + + - Added the classes :class:`aiogram.types.unique_gift_model.UniqueGiftModel`, + :class:`aiogram.types.unique_gift_symbol.UniqueGiftSymbol`, + :class:`aiogram.types.unique_gift_backdrop_colors.UniqueGiftBackdropColors`, + and :class:`aiogram.types.unique_gift_backdrop.UniqueGiftBackdrop` + to describe the properties of a unique gift. + - Added the class :class:`aiogram.types.unique_gift.UniqueGift` describing + a gift that was upgraded to a unique one. + - Added the class :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes` + describing the types of gifts that are accepted by a user or a chat. + - Replaced the field :code:`can_send_gift` with the field :code:`accepted_gift_types` + of the type :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes` + in the class :class:`aiogram.types.chat_full_info.ChatFullInfo`. + - Added the class :class:`aiogram.types.gift_info.GiftInfo` and the field :code:`gift` + to the class :class:`aiogram.types.message.Message`, + describing a service message about a regular gift that was sent or received. + - Added the class :class:`aiogram.types.unique_gift_info.UniqueGiftInfo` + and the field :code:`unique_gift` to the class :class:`aiogram.types.message.Message`, + describing a service message about a unique gift that was sent or received. + + **Telegram Premium** + + - Added the method :class:`aiogram.methods.gift_premium_subscription.GiftPremiumSubscription`, + allowing bots to gift a user a Telegram Premium subscription paid in Telegram Stars. + - Added the field :code:`premium_subscription_duration` to the class + :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser` + for transactions involving a Telegram Premium subscription purchased by the bot. + - Added the field :code:`transaction_type` to the class + :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`, + simplifying the differentiation and processing of all transaction types. + + **General** + + - Increased the maximum price for paid media to 10000 Telegram Stars. + - Increased the maximum price for a subscription period to 10000 Telegram Stars. + - Added the class :class:`aiogram.types.paid_message_price_changed.PaidMessagePriceChanged` + and the field :code:`paid_message_price_changed` to the class + :class:`aiogram.types.message.Message`, describing a service message about a price change + for paid messages sent to the chat. + - Added the field :code:`paid_star_count` to the class :class:`aiogram.types.message.Message`, + containing the number of Telegram Stars that were paid to send the message. + `#1671 `_ + + +Bugfixes +-------- + +- Fix memory exhaustion in polling mode with concurrent updates. + + Added a semaphore-based solution to limit the number of concurrent tasks when using :code:`handle_as_tasks=True` in polling mode. + This prevents Out of Memory (OOM) errors in memory-limited containers when there's a large queue of updates to process. + You can now control the maximum number of concurrent updates with the new :code:`tasks_concurrency_limit` + parameter in :code:`start_polling()` and :code:`run_polling()` methods. + `#1658 `_ +- Fix empty response into webhook. + + We need to return something “empty”, and “empty” form doesn’t work since + it’s sending only “end” boundary w/o “start”. + + An empty formdata should look smth like this for Telegram to understand: + + :: + + --webhookBoundaryvsF_aMHhspPjfOq7O0JNRg + --webhookBoundaryvsF_aMHhspPjfOq7O0JNRg-- + + But aiohttp sends only the ending boundary: + + :: + + --webhookBoundaryvsF_aMHhspPjfOq7O0JNRg-- + + Such response doesn't suit Telegram servers. + + The fix replaces empty response with empty JSON response: + + :: + + {} + `#1664 `_ + + +Improved Documentation +---------------------- + +- Fixed broken code block formatting in ``router.rst`` caused by incorrect indentation of directive options. + `#1666 `_ + + +Misc +---- + +- Bump pydantic upper bound from <2.11 to <2.12. + Upgrading `pydantic` to version 2.11 significantly reduces resource consumption, more details on the `pydantic blog post `_ + `#1659 `_ +- Replaced ```loop.run_in_executor``` with ```asyncio.to_thread``` for improved readability and consistency. + `#1661 `_ + + 3.19.0 (2025-03-19) ==================== diff --git a/CHANGES/1657.feature.rst b/CHANGES/1657.feature.rst deleted file mode 100644 index cbb7c51b..00000000 --- a/CHANGES/1657.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Add different shortcut methods for ``aiogram.utils.formatting.Text.as_kwargs()`` diff --git a/CHANGES/1658.bugfix.rst b/CHANGES/1658.bugfix.rst deleted file mode 100644 index 5752bce1..00000000 --- a/CHANGES/1658.bugfix.rst +++ /dev/null @@ -1,6 +0,0 @@ -Fix memory exhaustion in polling mode with concurrent updates. - -Added a semaphore-based solution to limit the number of concurrent tasks when using :code:`handle_as_tasks=True` in polling mode. -This prevents Out of Memory (OOM) errors in memory-limited containers when there's a large queue of updates to process. -You can now control the maximum number of concurrent updates with the new :code:`tasks_concurrency_limit` -parameter in :code:`start_polling()` and :code:`run_polling()` methods. diff --git a/CHANGES/1659.misc.rst b/CHANGES/1659.misc.rst deleted file mode 100644 index 88fdcd13..00000000 --- a/CHANGES/1659.misc.rst +++ /dev/null @@ -1,2 +0,0 @@ -Bump pydantic upper bound from <2.11 to <2.12. -Upgrading `pydantic` to version 2.11 significantly reduces resource consumption, more details on the `pydantic blog post `_ diff --git a/CHANGES/1661.misc.rst b/CHANGES/1661.misc.rst deleted file mode 100644 index b20cbc82..00000000 --- a/CHANGES/1661.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Replaced ```loop.run_in_executor``` with ```asyncio.to_thread``` for improved readability and consistency. diff --git a/CHANGES/1664.bugfix.rst b/CHANGES/1664.bugfix.rst deleted file mode 100644 index 9a4fb2a3..00000000 --- a/CHANGES/1664.bugfix.rst +++ /dev/null @@ -1,25 +0,0 @@ -Fix empty response into webhook. - -We need to return something “empty”, and “empty” form doesn’t work since -it’s sending only “end” boundary w/o “start”. - -An empty formdata should look smth like this for Telegram to understand: - -:: - - --webhookBoundaryvsF_aMHhspPjfOq7O0JNRg - --webhookBoundaryvsF_aMHhspPjfOq7O0JNRg-- - -But aiohttp sends only the ending boundary: - -:: - - --webhookBoundaryvsF_aMHhspPjfOq7O0JNRg-- - -Such response doesn't suit Telegram servers. - -The fix replaces empty response with empty JSON response: - -:: - - {} diff --git a/CHANGES/1666.doc.rst b/CHANGES/1666.doc.rst deleted file mode 100644 index ac768c87..00000000 --- a/CHANGES/1666.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed broken code block formatting in ``router.rst`` caused by incorrect indentation of directive options. diff --git a/CHANGES/1671.feature.rst b/CHANGES/1671.feature.rst deleted file mode 100644 index 4e480447..00000000 --- a/CHANGES/1671.feature.rst +++ /dev/null @@ -1,107 +0,0 @@ -Added full support for the `Bot API 9.0 `_: - -**Business Accounts** - -- Added the class :class:`aiogram.types.business_bot_rights.BusinessBotRights` and replaced - the field :code:`can_reply` with the field :code:`rights` of the type - :class:`aiogram.types.business_bot_rights.BusinessBotRights` in the class - :class:`aiogram.types.business_connection.BusinessConnection`. -- Added the method :class:`aiogram.methods.read_business_message.ReadBusinessMessage`, - allowing bots to mark incoming messages as read on behalf of a business account. -- Added the method :class:`aiogram.methods.delete_business_messages.DeleteBusinessMessages`, - allowing bots to delete messages on behalf of a business account. -- Added the method :class:`aiogram.methods.set_business_account_name.SetBusinessAccountName`, - allowing bots to change the first and last name of a managed business account. -- Added the method :class:`aiogram.methods.set_business_account_username.SetBusinessAccountUsername`, - allowing bots to change the username of a managed business account. -- Added the method :class:`aiogram.methods.set_business_account_bio.SetBusinessAccountBio`, - allowing bots to change the bio of a managed business account. -- Added the class :class:`aiogram.types.input_profile_photo.InputProfilePhoto`, - describing a profile photo to be set. -- Added the methods :class:`aiogram.methods.set_business_account_profile_photo.SetBusinessAccountProfilePhoto` - and :class:`aiogram.methods.remove_business_account_profile_photo.RemoveBusinessAccountProfilePhoto`, - allowing bots to change the profile photo of a managed business account. -- Added the method :class:`aiogram.methods.set_business_account_gift_settings.SetBusinessAccountGiftSettings`, - allowing bots to change the privacy settings pertaining to incoming gifts in a managed business account. -- Added the class :class:`aiogram.types.star_amount.StarAmount` and the method - :class:`aiogram.methods.get_business_account_star_balance.GetBusinessAccountStarBalance`, - allowing bots to check the current Telegram Star balance of a managed business account. -- Added the method :class:`aiogram.methods.transfer_business_account_stars.TransferBusinessAccountStars`, - allowing bots to transfer Telegram Stars from the balance of a managed business account to their own balance - for withdrawal. -- Added the classes :class:`aiogram.types.owned_gift_regular.OwnedGiftRegular`, - :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique`, :class:`aiogram.types.owned_gifts.OwnedGifts` - and the method :class:`aiogram.methods.get_business_account_gifts.GetBusinessAccountGifts`, - allowing bots to fetch the list of gifts owned by a managed business account. -- Added the method :class:`aiogram.methods.convert_gift_to_stars.ConvertGiftToStars`, - allowing bots to convert gifts received by a managed business account to Telegram Stars. -- Added the method :class:`aiogram.methods.upgrade_gift.UpgradeGift`, - allowing bots to upgrade regular gifts received by a managed business account to unique gifts. -- Added the method :class:`aiogram.methods.transfer_gift.TransferGift`, - allowing bots to transfer unique gifts owned by a managed business account. -- Added the classes :class:`aiogram.types.input_story_content_photo.InputStoryContentPhoto` - and :class:`aiogram.types.input_story_content_video.InputStoryContentVideo` - representing the content of a story to post. -- Added the classes :class:`aiogram.types.story_area.StoryArea`, - :class:`aiogram.types.story_area_position.StoryAreaPosition`, - :class:`aiogram.types.location_address.LocationAddress`, - :class:`aiogram.types.story_area_type_location.StoryAreaTypeLocation`, - :class:`aiogram.types.story_area_type_suggested_reaction.StoryAreaTypeSuggestedReaction`, - :class:`aiogram.types.story_area_type_link.StoryAreaTypeLink`, - :class:`aiogram.types.story_area_type_weather.StoryAreaTypeWeather` - and :class:`aiogram.types.story_area_type_unique_gift.StoryAreaTypeUniqueGift`, - describing clickable active areas on stories. -- Added the methods :class:`aiogram.methods.post_story.PostStory`, - :class:`aiogram.methods.edit_story.EditStory` - and :class:`aiogram.methods.delete_story.DeleteStory`, - allowing bots to post, edit and delete stories on behalf of a managed business account. - -**Mini Apps** - -- Added the field :code:`DeviceStorage`, allowing Mini Apps to use persistent - local storage on the user's device. -- Added the field :code:`SecureStorage`, allowing Mini Apps to use a secure local - storage on the user's device for sensitive data. - -**Gifts** - -- Added the classes :class:`aiogram.types.unique_gift_model.UniqueGiftModel`, - :class:`aiogram.types.unique_gift_symbol.UniqueGiftSymbol`, - :class:`aiogram.types.unique_gift_backdrop_colors.UniqueGiftBackdropColors`, - and :class:`aiogram.types.unique_gift_backdrop.UniqueGiftBackdrop` - to describe the properties of a unique gift. -- Added the class :class:`aiogram.types.unique_gift.UniqueGift` describing - a gift that was upgraded to a unique one. -- Added the class :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes` - describing the types of gifts that are accepted by a user or a chat. -- Replaced the field :code:`can_send_gift` with the field :code:`accepted_gift_types` - of the type :class:`aiogram.types.accepted_gift_types.AcceptedGiftTypes` - in the class :class:`aiogram.types.chat_full_info.ChatFullInfo`. -- Added the class :class:`aiogram.types.gift_info.GiftInfo` and the field :code:`gift` - to the class :class:`aiogram.types.message.Message`, - describing a service message about a regular gift that was sent or received. -- Added the class :class:`aiogram.types.unique_gift_info.UniqueGiftInfo` - and the field :code:`unique_gift` to the class :class:`aiogram.types.message.Message`, - describing a service message about a unique gift that was sent or received. - -**Telegram Premium** - -- Added the method :class:`aiogram.methods.gift_premium_subscription.GiftPremiumSubscription`, - allowing bots to gift a user a Telegram Premium subscription paid in Telegram Stars. -- Added the field :code:`premium_subscription_duration` to the class - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser` -for transactions involving a Telegram Premium subscription purchased by the bot. -- Added the field :code:`transaction_type` to the class - :class:`aiogram.types.transaction_partner_user.TransactionPartnerUser`, - simplifying the differentiation and processing of all transaction types. - -**General** - -- Increased the maximum price for paid media to 10000 Telegram Stars. -- Increased the maximum price for a subscription period to 10000 Telegram Stars. -- Added the class :class:`aiogram.types.paid_message_price_changed.PaidMessagePriceChanged` - and the field :code:`paid_message_price_changed` to the class - :class:`aiogram.types.message.Message`, describing a service message about a price change - for paid messages sent to the chat. -- Added the field :code:`paid_star_count` to the class :class:`aiogram.types.message.Message`, - containing the number of Telegram Stars that were paid to send the message.