Added full support for the Bot API 9.0 (#1671)

* Added full support for the Bot API 9.0

* Bump version
This commit is contained in:
Alex Root Junior 2025-04-12 23:29:48 +03:00 committed by GitHub
parent 25e9127db9
commit 2c2bd61551
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
231 changed files with 9565 additions and 389 deletions

107
CHANGES/1671.feature.rst Normal file
View file

@ -0,0 +1,107 @@
Added full support for the `Bot API 9.0 <https://core.telegram.org/bots/api-changelog#april-11-2025>`_:
**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.