Add support for Telegram Bot API 9.1 (#1704)

* Add support for Telegram Bot API 9.1 features, including checklists, gifts, and new methods like `SendChecklist`, `EditMessageChecklist`, and `GetMyStarBalance`. Update changelog and improve `True` field descriptions.

* Bump API Version

* Refactor profile photo types to use `InputProfilePhotoType` enums instead of hardcoded literals

* Refactor imports and clean up redundant code across methods, types, and webhook server classes
This commit is contained in:
Alex Root Junior 2025-07-05 03:02:44 +03:00 committed by GitHub
parent 77ca49518e
commit f060c08d16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
117 changed files with 2565 additions and 466 deletions

25
CHANGES/1704.feature.rst Normal file
View file

@ -0,0 +1,25 @@
Added full support for the `Bot API 9.1 <https://core.telegram.org/bots/api-changelog#july-3-2025>`_:
**Checklists**
- Added the class :class:`aiogram.types.checklist_task.ChecklistTask` representing a task in a checklist.
- Added the class :class:`aiogram.types.checklist.Checklist` representing a checklist.
- Added the class :class:`aiogram.types.input_checklist_task.InputChecklistTask` representing a task to add to a checklist.
- Added the class :class:`aiogram.types.input_checklist.InputChecklist` representing a checklist to create.
- Added the field :code:`checklist` to the classes :class:`aiogram.types.message.Message` and :class:`aiogram.types.external_reply_info.ExternalReplyInfo`, describing a checklist in a message.
- Added the class :class:`aiogram.types.checklist_tasks_done.ChecklistTasksDone` and the field :code:`checklist_tasks_done` to the class :class:`aiogram.types.message.Message`, describing a service message about status changes for tasks in a checklist (i.e., marked as done/not done).
- Added the class :class:`aiogram.types.checklist_tasks_added.ChecklistTasksAdded` and the field :code:`checklist_tasks_added` to the class :class:`aiogram.types.message.Message`, describing a service message about the addition of new tasks to a checklist.
- Added the method :class:`aiogram.methods.send_checklist.SendChecklist`, allowing bots to send a checklist on behalf of a business account.
- Added the method :class:`aiogram.methods.edit_message_checklist.EditMessageChecklist`, allowing bots to edit a checklist on behalf of a business account.
**Gifts**
- Added the field :code:`next_transfer_date` to the classes :class:`aiogram.types.owned_gift_unique.OwnedGiftUnique` and :class:`aiogram.types.unique_gift_info.UniqueGiftInfo`.
- Added the field :code:`last_resale_star_count` to the class :class:`aiogram.types.unique_gift_info.UniqueGiftInfo`.
- Added "resale" as the possible value of the field :code:`origin` in the class :class:`aiogram.types.unique_gift_info.UniqueGiftInfo`.
**General**
- Increased the maximum number of options in a poll to 12.
- Added the method :class:`aiogram.methods.get_my_star_balance.GetMyStarBalance`, allowing bots to get their current balance of Telegram Stars.
- Added the class :class:`aiogram.types.direct_message_price_changed.DirectMessagePriceChanged` and the field :code:`direct_message_price_changed` to the class :class:`aiogram.types.message.Message`, describing a service message about a price change for direct messages sent to the channel chat.