Changelog¶
3.15.0 (2024-11-17)¶
Features¶
Added full support for Bot API 8.0
Added the parameter
subscription_period
to the methodaiogram.methods.create_invoice_link.CreateInvoiceLink
to support the creation of links that are billed periodically.Added the parameter
business_connection_id
to the methodaiogram.methods.create_invoice_link.CreateInvoiceLink
to support the creation of invoice links on behalf of business accounts.Added the fields
subscription_expiration_date
,is_recurring
andis_first_recurring
to the classaiogram.types.successful_payment.SuccessfulPayment
.Added the method
aiogram.methods.edit_user_star_subscription.EditUserStarSubscription
.Added the field
subscription_period
to the classaiogram.types.transaction_partner_user.TransactionPartnerUser
.Added the method
aiogram.methods.set_user_emoji_status.SetUserEmojiStatus
. The user must allow the bot to manage their emoji status.Added the class
aiogram.types.prepared_inline_message.PreparedInlineMessage
and the methodaiogram.methods.save_prepared_inline_message.SavePreparedInlineMessage
, allowing bots to suggest users send a specific message from a Mini App via the methodaiogram.methods.share_message.ShareMessage
.Added the classes
aiogram.types.gift.Gift
andaiogram.types.gifts.Gifts
and the methodaiogram.methods.get_available_gifts.GetAvailableGifts
, allowing bots to get all gifts available for sending.Added the field
gift
to the classaiogram.types.transaction_partner_user.TransactionPartnerUser
.
3.14.0 (2024-11-02)¶
Misc¶
Checked compatibility with Python 3.13 (added to the CI/CD processes), so now aiogram is totally compatible with it.
Dropped compatibility with Python 3.8 due to this version being EOL.
Warning
In some cases you will need to have the installed compiler (Rust or C++) to install some of the dependencies to compile packages from source on pip install command.
If you are using Windows, you will need to have the Visual Studio installed.
If you are using Linux, you will need to have the build-essential package installed.
If you are using macOS, you will need to have the Xcode installed.
When developers of this dependencies will release new versions with precompiled wheels for Windows, Linux and macOS, this action will not be necessary anymore until the next version of the Python interpreter.
Added business_connection_id to the
aiogram.types.message.Message
API methods shortcuts.Integrated the
business_connection_id
attribute into various message manipulation methods, ensuring consistent data handling. This update eliminates the need to pass thebusiness_connection_id
as a parameter, instead directly accessing it from the instance attributes. #1586
Features¶
Add function
get_value
to all built-in storage implementations,FSMContext
andSceneWizard
#1431Enhanced the inheritance of handlers and actions in Scenes. Refactored to eliminate the copying of previously connected handlers and actions from parent scenes. Now, handlers are dynamically rebuilt based on the current class, properly utilizing class inheritance and enabling handler overrides.
That’s mean that you can now override handlers and actions in the child scene, instead of copying and duplicating them. #1583
Added full support of Bot API 7.11
Added the class
aiogram.types.copy_text_button.CopyTextButton
and the fieldcopy_text
in the classaiogram.types.inline_keyboard_button.InlineKeyboardButton
, allowing bots to send and receive inline buttons that copy arbitrary text.Added the parameter
allow_paid_broadcast
to the methodsaiogram.methods.send_message.SendMessage
,aiogram.methods.send_photo.SendPhoto
,aiogram.methods.send_video.SendVideo
,aiogram.methods.send_animation.SendAnimation
,aiogram.methods.send_audio.SendAudio
,aiogram.methods.send_document.SendDocument
,aiogram.methods.send_paid_media.SendPaidMedia
,aiogram.methods.send_sticker.SendSticker
,aiogram.methods.send_video_note.SendVideoNote
,aiogram.methods.send_voice.SendVoice
,aiogram.methods.send_location.SendLocation
,aiogram.methods.send_venue.SendVenue
,aiogram.methods.send_contact.SendContact
,aiogram.methods.send_poll.SendPoll
,aiogram.methods.send_dice.SendDice
,aiogram.methods.send_invoice.SendInvoice
,aiogram.methods.send_game.SendGame
,aiogram.methods.send_media_group.SendMediaGroup
andaiogram.methods.copy_message.CopyMessage
.Added the class
aiogram.types.transaction_partner_telegram_api.TransactionPartnerTelegramApi
for transactions related to paid broadcasted messages.Introduced the ability to add media to existing text messages using the method
aiogram.methods.edit_message_media.EditMessageMedia
.Added support for hashtag and cashtag entities with a specified chat username that opens a search for the relevant tag within the specified chat.
Bugfixes¶
Fix PytestDeprecationWarning thrown by pytest-asyncio when running the tests #1584
Fixed customized serialization in the
aiogram.filters.callback_data.CallbackData
factory.From now UUID will have 32 bytes length instead of 36 bytes (with no - separators) in the callback data representation. #1602
Improved Documentation¶
Add missing closing tag for bold. #1599
3.13.1 (2024-09-18)¶
Warning
Python 3.8 End of Life: Python 3.8 will reach its end of life (EOL) soon and will no longer be supported by aiogram in the next releases (1-2 months ETA).
Please upgrade to a newer version of Python to ensure compatibility and receive future updates.
Misc¶
Bugfixes¶
Fixed Default object annotation resolution using pydantic #1579
3.13.0 (2024-09-08)¶
Features¶
Added updates about purchased paid media, represented by the class
aiogram.types.paid_media_purchased.PaidMediaPurchased
and the fieldpurchased_paid_media
in the classaiogram.types.update.Update
.Added the ability to specify a payload in
aiogram.methods.send_paid_media.SendPaidMedia
that is received back by the bot inaiogram.types.transaction_partner_user.TransactionPartnerUser
andpurchased_paid_media
updates.Added the field
prize_star_count
to the classesaiogram.types.giveaway_created.GiveawayCreated
,aiogram.types.giveaway.Giveaway
,aiogram.types.giveaway_winners.GiveawayWinners
andaiogram.types.chat_boost_source_giveaway.ChatBoostSourceGiveaway
.Added the field
is_star_giveaway
to the classaiogram.types.giveaway_completed.GiveawayCompleted
.
Added missing method aliases such as .answer(), .reply(), and others to InaccessibleMessage. This change ensures consistency and improves usability by aligning the functionality of InaccessibleMessage with the Message type. #1574
Bugfixes¶
Fixed link preview options to use global defaults in various types and methods to use global defaults for link_preview_options. This change ensures consistency and enhances flexibility in handling link preview options across different components. #1543
3.12.0 (2024-08-16)¶
Features¶
Added message_thread_id parameter to message.get_url(). #1451
Added getting user from chat_boost with source ChatBoostSourcePremium in UserContextMiddleware for EventContext #1474
Added full support of Bot API 7.8
Added the ability to send paid media to any chat.
Added the parameter
business_connection_id
to the methodaiogram.methods.send_paid_media.SendPaidMedia
, allowing bots to send paid media on behalf of a business account.Added the field
paid_media
to the classaiogram.types.transaction_partner_user.TransactionPartnerUser
for transactions involving paid media.Added the method
aiogram.methods.create_chat_subscription_invite_link.CreateChatSubscriptionInviteLink
, allowing bots to create subscription invite links.Added the method
aiogram.methods.edit_chat_subscription_invite_link.EditChatSubscriptionInviteLink
, allowing bots to edit the name of subscription invite links.Added the field
until_date
to the classaiogram.types.chat_member_member.ChatMemberMember
for members with an active subscription.Added support for paid reactions and the class
aiogram.types.reaction_type_paid.ReactionTypePaid
.
Misc¶
Improved performance of StatesGroup #1507
3.11.0 (2024-08-09)¶
Features¶
Added full support of Bot API 7.8
Added the field
has_main_web_app
to the classaiogram.types.user.User
, which is returned in the response toaiogram.methods.get_me.GetMe
.Added the parameter
business_connection_id
to the methodsaiogram.methods.pin_chat_message.PinChatMessage
andaiogram.methods.unpin_chat_message.UnpinChatMessage
, allowing bots to manage pinned messages on behalf of a business account.
Bugfixes¶
Fixed URL path in the “Open” button at the “demo/sendMessage” endpoint in the web_app example. #1546
Misc¶
Added method
aiogram.types.message.Message.as_reply_parameters()
. Replaced usage of the argumentreply_to_message_id
withreply_parameters
in all Message reply methods. #1538Added aiohttp v3.10 ` support. #1548
3.10.0 (2024-07-07)¶
Features¶
Added full support of Bot API 7.7
Added the class
aiogram.types.refunded_payment.RefundedPayment
, containing information about a refunded payment.Added the field
refunded_payment
to the classaiogram.types.message.Message
, describing a service message about a refunded payment.
3.9.0 (2024-07-06)¶
Features¶
Added ChatMember resolution tool and updated 2.x migration guide. #1525
Added full support of Bot API 7.6
- Added the classes
aiogram.types.paid_media.PaidMedia
, aiogram.types.paid_media_info.PaidMediaInfo
,aiogram.types.paid_media_preview.PaidMediaPreview
,aiogram.types.paid_media_photo.PaidMediaPhoto
andaiogram.types.paid_media_video.PaidMediaVideo
, containing information about paid media.
- Added the classes
- Added the method
aiogram.methods.send_paid_media.SendPaidMedia
and the classes
aiogram.types.input_paid_media.InputPaidMedia
,aiogram.types.input_paid_media_photo.InputPaidMediaPhoto
andaiogram.types.input_paid_media_video.InputPaidMediaVideo
, to support sending paid media.
- Added the method
- Documented that the methods
aiogram.methods.copy_message.CopyMessage
and
aiogram.methods.copy_messages.CopyMessages
cannot be used to copy paid media.
- Documented that the methods
- Added the field
can_send_paid_media
to the class
- Added the field
- Added the field
paid_media
to the classes aiogram.types.message.Message
andaiogram.types.external_reply_info.ExternalReplyInfo
.
- Added the field
- Added the class
aiogram.types.transaction_partner_telegram_ads.TransactionPartnerTelegramAds
, containing information about Telegram Star transactions involving the Telegram Ads Platform.
- Added the field
invoice_payload
to the class aiogram.types.transaction_partner_user.TransactionPartnerUser
, containing the bot-specified invoice payload.
- Added the field
Changed the default opening mode for Direct Link Mini Apps.
- Added support for launching Web Apps via t.me link in the class
Added the field
section_separator_color
to the classThemeParams
.
Bugfixes¶
Fixed event context resolving for the callback query that is coming from the business account #1520
3.8.0 (2024-06-19)¶
Features¶
Added utility to safely deserialize any Telegram object or method to a JSON-compatible object (dict). (>> Read more) #1450
Added full support of Bot API 7.5
- Added the classes
aiogram.types.star_transactions.StarTransactions
, aiogram.types.star_transaction.StarTransaction
,aiogram.types.transaction_partner.TransactionPartner
andaiogram.types.revenue_withdrawal_state.RevenueWithdrawalState
, containing information about Telegram Star transactions involving the bot.
- Added the classes
- Added the method
aiogram.methods.get_star_transactions.GetStarTransactions
that can be used to get the list of all Telegram Star transactions for the bot.
- Added the method
- Added support for callback buttons in
aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup
for messages sent on behalf of a business account.
- Added support for callback queries originating from a message sent
on behalf of a business account.
- Added the parameter
business_connection_id
to the methods aiogram.methods.edit_message_text.EditMessageText
,aiogram.methods.edit_message_media.EditMessageMedia
,aiogram.methods.edit_message_caption.EditMessageCaption
,aiogram.methods.edit_message_live_location.EditMessageLiveLocation
,aiogram.methods.stop_message_live_location.StopMessageLiveLocation
andaiogram.methods.edit_message_reply_markup.EditMessageReplyMarkup
, allowing the bot to edit business messages.
- Added the parameter
- Added the parameter
business_connection_id
to the method aiogram.methods.stop_poll.StopPoll
, allowing the bot to stop polls it sent on behalf of a business account.
- Added the parameter
Bugfixes¶
Increased DNS cache ttl setting to aiohttp session as a workaround for DNS resolution issues in aiohttp. #1500
Improved Documentation¶
Misc¶
[Only for contributors] Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring
If incorrect URIs provided to “–redis” and/or “–mongo” options tests should fail with errors instead of skipping. Otherwise the next scenario is possible:
developer breaks RedisStorage and/or MongoStorage code
tests are run with incorrect redis and/or mongo URIsprovided by “–redis” and “–mongo” options (for example, wrong port specified)
tests pass because skipping doesn’t fail tests run
developer or reviewer doesn’t notice that redis and/or mongo tests were skipped
broken code gets in codebase
Also some refactorings done (related with storages and storages tests). #1510
3.7.0 (2024-05-31)¶
Features¶
Added new storage
aiogram.fsm.storage.MongoStorage
for Finite State Machine based on Mongo DB (usingmotor
library) #1434Added full support of Bot API 7.4 #1498
Bugfixes¶
Fixed wrong
MarkdownV2
custom emoji parsing inaiogram.utils.text_decorations
#1496
Deprecations and Removals¶
Removed deprecated arguments from Bot class
parse_mode
,disable_web_page_preview
,protect_content
as previously announced in v3.4.0. #1494
Misc¶
Improved code consistency and readability in code examples by refactoring imports, adjusting the base webhook URL, modifying bot instance initialization to utilize DefaultBotProperties, and updating router message handlers. #1482
3.6.0 (2024-05-06)¶
Features¶
Added full support of Bot API 7.3 #1480
Improved Documentation¶
Added telegram objects transformation block in 2.x -> 3.x migration guide #1412
3.5.0 (2024-04-23)¶
Features¶
Bugfixes¶
WebAppUser Class Fields: Added missing is_premium, added_to_attachment_menu, and allows_write_to_pm fields to WebAppUser class to align with the Telegram API.
WebAppChat Class Implementation: Introduced the WebAppChat class with all its fields (id, type, title, username, and photo_url) as specified in the Telegram API, which was previously missing from the library.
WebAppInitData Class Fields: Included previously omitted fields in the WebAppInitData class: chat, chat_type, chat_instance, to match the official documentation for a complete Telegram Web Apps support.
Fixed poll answer FSM context by handling
voter_chat
forpoll_answer
event #1436Added missing error handling to
_background_feed_update
(when inhandle_in_background=True
webhook mode) #1458
Improved Documentation¶
Added WebAppChat class to WebApp docs, updated uk_UA localisation of WebApp docs. #1433
Misc¶
Added full support of Bot API 7.2 #1444
Loosened pydantic version upper restriction from
<2.7
to<2.8
#1460
3.4.1 (2024-02-17)¶
Bugfixes¶
Fixed JSON serialization of the
LinkPreviewOptions
class while it is passed as bot-wide default options. #1418
3.4.0 (2024-02-16)¶
Features¶
Reworked bot-wide globals like
parse_mode
,disable_web_page_preview
, and others to be more flexible.Warning
Note that the old way of setting these global bot properties is now deprecated and will be removed in the next major release.
A new enum
KeyboardButtonPollTypeType
forKeyboardButtonPollTypeType.type
field has bed added. #1398Added full support of Bot API 7.1
Added support for the administrator rights
can_post_stories
,can_edit_stories
,can_delete_stories
in supergroups.Added the class
ChatBoostAdded
and the fieldboost_added
to the classMessage
for service messages about a user boosting a chat.Added the field
sender_boost_count
to the classMessage
.Added the field
reply_to_story
to the classMessage
.Added the fields
chat
andid
to the classStory
.Added the field
unrestrict_boost_count
to the classChat
.Added the field
custom_emoji_sticker_set_name
to the classChat
.
Bugfixes¶
Improved Documentation¶
Add notion “Working with plural forms” in documentation Utils -> Translation #1395
3.3.0 (2023-12-31)¶
Features¶
Added full support of Bot API 7.0
Reactions
Replies 2.0
Link Preview Customization
Block Quotation
Multiple Message Actions
Requests for multiple users
Chat Boosts
Giveaway
Other changes
3.2.0 (2023-11-24)¶
Features¶
Bugfixes¶
Improved Documentation¶
Corrected grammatical errors, improved sentence structures, translation for migration 2.x-3.x #1302
Minor typo correction, specifically in module naming + some grammar. #1340
Added CITATION.cff file for automatic academic citation generation. Now you can copy citation from the GitHub page and paste it into your paper. #1351
Minor typo correction in middleware docs. #1353
Misc¶
Fixed ResourceWarning in the tests, reworked
RedisEventsIsolation
fixture to use Redis connection fromRedisStorage
#1320Updated dependencies, bumped minimum required version:
magic-filter
- fixed .resolve operationpydantic
- fixed compatibility (broken in 2.4)aiodns
- added new dependency to thefast
extras (pip install aiogram[fast]
)others…
Prevent update handling task pointers from being garbage collected, backport from 2.x #1331
Updated
typing-extensions
package version range in dependencies to fix compatibility withFastAPI
#1347Introduce Python 3.12 support #1354
Speeded up CallableMixin processing by caching references to nested objects and simplifying kwargs assembly. #1357
Added
pydantic
v2.5 support. #1361Updated
thumbnail
fields type toInputFile
only #1372
3.1.1 (2023-09-25)¶
Bugfixes¶
Fixed pydantic version <2.4, since 2.4 has breaking changes. #1322
3.1.0 (2023-09-22)¶
Features¶
Added support for custom encoders/decoders for payload (and also for deep-linking). #1262
Added
aiogram.utils.input_media.MediaGroupBuilder
for media group construction. #1293Added full support of Bot API 6.9 #1319
Bugfixes¶
3.0.0 (2023-09-01)¶
Bugfixes¶
Replaced
datetime.datetime
with DateTime type wrapper across types to make dumped JSONs object more compatible with data that is sent by Telegram. #1277Fixed magic
.as_(...)
operation for values that can be interpreted as False (e.g. 0). #1281Italic markdown from utils now uses correct decorators #1282
Fixed method
Message.send_copy
for stickers. #1284Fixed
Message.send_copy
method, which was not working properly with stories, so not you can copy stories too (forwards messages). #1286Fixed error overlapping when validation error is caused by remove_unset root validator in base types and methods. #1290
3.0.0rc2 (2023-08-18)¶
Bugfixes¶
Fixed missing message content types (
ContentType.USER_SHARED
,ContentType.CHAT_SHARED
) #1252Fixed nested hashtag, cashtag and email message entities not being parsed correctly when these entities are inside another entity. #1259
Moved global filters check placement into router to add chance to pass context from global filters into handlers in the same way as it possible in other places #1266
Improved Documentation¶
Added error handling example examples/error_handling.py #1099
Added a few words about skipping pending updates #1251
Added a section on Dependency Injection technology #1253
This update includes the addition of a multi-file bot example to the repository. #1254
Refactored examples code to use aiogram enumerations and enhanced chat messages with markdown beautification’s for a more user-friendly display. #1256
Supplemented “Finite State Machine” section in Migration FAQ #1264
Removed extra param in docstring of TelegramEventObserver’s filter method and fixed typo in I18n documentation. #1268
Misc¶
Enhanced the warning message in dispatcher to include a JSON dump of the update when update type is not known. #1269
Added support for Bot API 6.8 #1275
3.0.0rc1 (2023-08-06)¶
Features¶
Added Currency enum. You can use it like this:
from aiogram.enums import Currency await bot.send_invoice( ..., currency=Currency.USD, ... )
Updated keyboard builders with new methods for integrating buttons and keyboard creation more seamlessly. Added functionality to create buttons from existing markup and attach another builder. This improvement aims to make the keyboard building process more user-friendly and flexible. #1236
Added support for message_thread_id in ChatActionSender #1249
Bugfixes¶
Improved Documentation¶
Added documentation for webhook and polling modes. #1241
Misc¶
3.0.0b9 (2023-07-30)¶
Features¶
Added new shortcuts for
aiogram.types.chat_member_updated.ChatMemberUpdated
to send message to chat that member joined/left. #1234Added new shortcuts for
aiogram.types.chat_join_request.ChatJoinRequest
to make easier access to sending messages to users who wants to join to chat. #1235
Bugfixes¶
Fixed bot assignment in the
Message.send_copy
shortcut #1232Added model validation to remove UNSET before field validation. This change was necessary to correctly handle parse_mode where ‘UNSET’ is used as a sentinel value. Without the removal of ‘UNSET’, it would create issues when passed to model initialization from Bot.method_name. ‘UNSET’ was also added to typing. #1233
Updated pydantic to 2.1 with few bugfixes
Improved Documentation¶
Improved docs, added basic migration guide (will be expanded later) #1143
Deprecations and Removals¶
Removed the use of the context instance (Bot.get_current) from all placements that were used previously. This is to avoid the use of the context instance in the wrong place. #1230
3.0.0b8 (2023-07-17)¶
Features¶
Added possibility to use custom events in routers (If router does not support custom event it does not break and passes it to included routers). #1147
Added support for FSM in Forum topics.
The strategy can be changed in dispatcher:
from aiogram.fsm.strategy import FSMStrategy ... dispatcher = Dispatcher( fsm_strategy=FSMStrategy.USER_IN_TOPIC, storage=..., # Any persistent storage )
Note
If you have implemented you own storages you should extend record key generation with new one attribute -
thread_id
Improved CallbackData serialization.
Minimized UUID (hex without dashes)
Replaced bool values with int (true=1, false=0)
Added a tool to make text formatting flexible and easy. More details on the corresponding documentation page #1172
Added
X-Telegram-Bot-Api-Secret-Token
header check #1173Made
allowed_updates
list to revolve automatically in start_polling method if not set explicitly. #1178Added possibility to pass custom headers to
URLInputFile
object #1191
Bugfixes¶
Change type of result in InlineQueryResult enum for
InlineQueryResultCachedMpeg4Gif
andInlineQueryResultMpeg4Gif
to more correct according to documentation.Change regexp for entities parsing to more correct (
InlineQueryResultType.yml
). #1146Fixed signature of startup/shutdown events to include the
**dispatcher.workflow_data
as the handler arguments. #1155Added missing
FORUM_TOPIC_EDITED
value to content_type property #1160Fixed compatibility with Python 3.8-3.9 (from previous release) #1162
Fixed the markdown spoiler parser. #1176
Fixed workflow data propagation #1196
Fixed the serialization error associated with nested subtypes like InputMedia, ChatMember, etc.
The previously generated code resulted in an invalid schema under pydantic v2, which has stricter type parsing. Hence, subtypes without the specification of all subtype unions were generating an empty object. This has been rectified now. #1213
Improved Documentation¶
Changed small grammar typos for
upload_file
#1133
Deprecations and Removals¶
Removed text filter in due to is planned to remove this filter few versions ago.
Use
F.text
instead #1170
Misc¶
Added full support of Bot API 6.6
Danger
Note that this issue has breaking changes described in the Bot API changelog, this changes is not breaking in the API but breaking inside aiogram because Beta stage is not finished.
Added full support of Bot API 6.7
Warning
Note that arguments switch_pm_parameter and switch_pm_text was deprecated and should be changed to button argument as described in API docs.
Updated Pydantic to V2
Warning
Be careful, not all libraries is already updated to using V2
Added global defaults
disable_web_page_preview
andprotect_content
in addition toparse_mode
to the Bot instance, reworked internal request builder mechanism. #1142Removed bot parameters from storages #1144
Replaced ContextVar’s with a new feature called Validation Context in Pydantic to improve the clarity, usability, and versatility of handling the Bot instance within method shortcuts.
Danger
Breaking: The ‘bot’ argument now is required in URLInputFile
Updated magic-filter with new features
Added hint for
len(F)
errorAdded not in operation
3.0.0b7 (2023-02-18)¶
Warning
Note that this version has incompatibility with Python 3.8-3.9 in case when you create an instance of Dispatcher outside of the any coroutine.
Sorry for the inconvenience, it will be fixed in the next version.
This code will not work:
dp = Dispatcher()
def main():
...
dp.run_polling(...)
main()
But if you change it like this it should works as well:
router = Router()
async def main():
dp = Dispatcher()
dp.include_router(router)
...
dp.start_polling(...)
asyncio.run(main())
Features¶
Added missing shortcuts, new enums, reworked old stuff
Breaking All previously added enums is re-generated in new place - aiogram.enums instead of aiogram.types
- Added enums:
aiogram.enums.bot_command_scope_type.BotCommandScopeType
, aiogram.enums.chat_action.ChatAction
,aiogram.enums.chat_member_status.ChatMemberStatus
,aiogram.enums.chat_type.ChatType
,aiogram.enums.content_type.ContentType
,aiogram.enums.dice_emoji.DiceEmoji
,aiogram.enums.inline_query_result_type.InlineQueryResultType
,aiogram.enums.input_media_type.InputMediaType
,aiogram.enums.mask_position_point.MaskPositionPoint
,aiogram.enums.menu_button_type.MenuButtonType
,aiogram.enums.message_entity_type.MessageEntityType
,aiogram.enums.parse_mode.ParseMode
,aiogram.enums.poll_type.PollType
,aiogram.enums.sticker_type.StickerType
,aiogram.enums.topic_icon_color.TopicIconColor
,aiogram.enums.update_type.UpdateType
,
Added shortcuts:
- Chat
aiogram.types.chat.Chat.get_administrators()
, aiogram.types.chat.Chat.delete_message()
,aiogram.types.chat.Chat.revoke_invite_link()
,aiogram.types.chat.Chat.edit_invite_link()
,aiogram.types.chat.Chat.create_invite_link()
,aiogram.types.chat.Chat.export_invite_link()
,aiogram.types.chat.Chat.do()
,aiogram.types.chat.Chat.delete_sticker_set()
,aiogram.types.chat.Chat.set_sticker_set()
,aiogram.types.chat.Chat.get_member()
,aiogram.types.chat.Chat.get_member_count()
,aiogram.types.chat.Chat.leave()
,aiogram.types.chat.Chat.unpin_all_messages()
,aiogram.types.chat.Chat.unpin_message()
,aiogram.types.chat.Chat.pin_message()
,aiogram.types.chat.Chat.set_administrator_custom_title()
,aiogram.types.chat.Chat.set_permissions()
,aiogram.types.chat.Chat.promote()
,aiogram.types.chat.Chat.restrict()
,aiogram.types.chat.Chat.unban()
,aiogram.types.chat.Chat.ban()
,aiogram.types.chat.Chat.set_description()
,aiogram.types.chat.Chat.set_title()
,aiogram.types.chat.Chat.delete_photo()
,aiogram.types.chat.Chat.set_photo()
,
- Chat
- Added enums:
Added callback answer feature #1091
Added a method that allows you to compactly register routers #1117
Bugfixes¶
Check status code when downloading file #816
Fixed ignore_case parameter in
aiogram.filters.command.Command
filter #1106
Misc¶
Added integration with new code-generator named Butcher #1069
Added full support of Bot API 6.4 #1088
Updated package metadata, moved build internals from Poetry to Hatch, added contributing guides. #1095
Added full support of Bot API 6.5
Danger
Note that
aiogram.types.chat_permissions.ChatPermissions
is updated without backward compatibility, so now this object has nocan_send_media_messages
attributeReplaced error
TypeError: TelegramEventObserver.__call__() got an unexpected keyword argument '<name>'
with a more understandable one for developers and with a link to the documentation. #1114Added possibility to reply into webhook with files #1120
Reworked graceful shutdown. Added method to stop polling. Now polling started from dispatcher can be stopped by signals gracefully without errors (on Linux and Mac). #1124
3.0.0b6 (2022-11-18)¶
Features¶
(again) Added possibility to combine filters with an and/or operations.
Read more in “Combining filters” documentation section #1018
Added following methods to
Message
class:Message.forward(...)
Message.edit_media(...)
Message.edit_live_location(...)
Message.stop_live_location(...)
Message.pin(...)
Message.unpin()
Added following methods to
User
class:User.mention_markdown(...)
User.mention_html(...)
Added full support of Bot API 6.3 #1057
Bugfixes¶
Improved Documentation¶
Misc¶
Enabled testing on Python 3.11 #1044
Added a mandatory dependency
certifi
in due to in some cases on systems that doesn’t have updated ca-certificates the requests to Bot API fails with reason[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain
#1066
3.0.0b5 (2022-10-02)¶
Features¶
Add PyPy support and run tests under PyPy #985
Added message text to aiogram exceptions representation #988
Added warning about using magic filter from magic_filter instead of aiogram’s ones. Is recommended to use from aiogram import F instead of from magic_filter import F #990
Added more detailed error when server response can’t be deserialized. This feature will help to debug unexpected responses from the Server #1014
Bugfixes¶
Reworked error event, introduced
aiogram.types.error_event.ErrorEvent
object. #898Fixed escaping markdown in aiogram.utils.markdown module #903
Fixed polling crash when Telegram Bot API raises HTTP 429 status-code. #995
Fixed empty mention in command parsing, now it will be None instead of an empty string #1013
Improved Documentation¶
Initialized Docs translation (added Ukrainian language) #925
Deprecations and Removals¶
Removed filters factory as described in corresponding issue. #942
Misc¶
Now Router/Dispatcher accepts only keyword arguments. #982
3.0.0b4 (2022-08-14)¶
Features¶
Add class helper ChatAction for constants that Telegram BotAPI uses in sendChatAction request. In my opinion, this will help users and will also improve compatibility with 2.x version where similar class was called “ChatActions”. #803
Added possibility to combine filters or invert result
Example:
Text(text="demo") | Command(commands=["demo"]) MyFilter() & AnotherFilter() ~StateFilter(state='my-state')
Fixed type hints for redis TTL params. #922
Added full_name shortcut for Chat object #929
Bugfixes¶
Fixed false-positive coercing of Union types in API methods #901
Added 3 missing content types:
proximity_alert_triggered
supergroup_chat_created
channel_chat_created
Fixed the ability to compare the state, now comparison to copy of the state will return True. #927
Fixed default lock kwargs in RedisEventIsolation. #972
Misc¶
Restrict including routers with strings #896
Changed CommandPatterType to CommandPatternType in aiogram/dispatcher/filters/command.py #907
Added full support of Bot API 6.1 #936
Breaking! More flat project structure
These packages was moved, imports in your code should be fixed:
aiogram.dispatcher.filters
->aiogram.filters
aiogram.dispatcher.fsm
->aiogram.fsm
aiogram.dispatcher.handler
->aiogram.handler
aiogram.dispatcher.webhook
->aiogram.webhook
aiogram.dispatcher.flags/*
->aiogram.dispatcher.flags
(single module instead of package)
Removed deprecated
router.<event>_handler
androuter.register_<event>_handler
methods. #941Deprecated filters factory. It will be removed in next Beta (3.0b5) #942
MessageEntity method get_text was removed and extract was renamed to extract_from #944
Added full support of Bot API 6.2 #975
3.0.0b3 (2022-04-19)¶
Features¶
Added possibility to get command magic result as handler argument #889
Added full support of Telegram Bot API 6.0 #890
Bugfixes¶
Misc¶
Added automated check that pull-request adds a changes description to CHANGES directory #873
Changed
Message.html_text
andMessage.md_text
attributes behaviour when message has no text. The empty string will be used instead of raising error. #874Used redis-py instead of aioredis package in due to this packages was merged into single one #882
Solved common naming problem with middlewares that confusing too much developers - now you can’t see the middleware and middlewares attributes at the same point because this functionality encapsulated to special interface. #883
3.0.0b2 (2022-02-19)¶
Features¶
Added possibility to pass additional arguments into the aiohttp webhook handler to use this arguments inside handlers as the same as it possible in polling mode. #785
Added possibility to add handler flags via decorator (like pytest.mark decorator but aiogram.flags) #836
Added
ChatActionSender
utility to automatically sends chat action while long process is running.It also can be used as message middleware and can be customized via
chat_action
flag. #837
Bugfixes¶
Misc¶
3.0.0b1 (2021-12-12)¶
Features¶
Added new custom operation for MagicFilter named
as_
Now you can use it to get magic filter result as handler argument
from aiogram import F ... @router.message(F.text.regexp(r"^(\d+)$").as_("digits")) async def any_digits_handler(message: Message, digits: Match[str]): await message.answer(html.quote(str(digits))) @router.message(F.photo[-1].as_("photo")) async def download_photos_handler(message: Message, photo: PhotoSize, bot: Bot): content = await bot.download(photo)
Bugfixes¶
Fixed: Missing
ChatMemberHandler
import inaiogram/dispatcher/handler
#751
Misc¶
Check
destiny
in case of nowith_destiny
enabled in RedisStorage key builder #776Added full support of Bot API 5.5 #777
Stop using feature from #336. From now settings of client-session should be placed as initializer arguments instead of changing instance attributes. #778
Make TelegramAPIServer files wrapper in local mode bi-directional (server-client, client-server) Now you can convert local path to server path and server path to local path. #779
3.0.0a18 (2021-11-10)¶
Features¶
Breaking: Changed the signature of the session middlewares Breaking: Renamed AiohttpSession.make_request method parameter from call to method to match the naming in the base class Added middleware for logging outgoing requests #716
Improved description of filters resolving error. For example when you try to pass wrong type of argument to the filter but don’t know why filter is not resolved now you can get error like this:
aiogram.exceptions.FiltersResolveError: Unknown keyword filters: {'content_types'} Possible cases: - 1 validation error for ContentTypesFilter content_types Invalid content types {'42'} is not allowed here (type=value_error)
Breaking internal API change Reworked FSM Storage record keys propagation #723
Implemented new filter named
MagicData(magic_data)
that helps to filter event by data from middlewares or other filtersFor example your bot is running with argument named
config
that contains the application config then you can filter event by value from this config:@router.message(magic_data=F.event.from_user.id == F.config.admin_id) ...
Bugfixes¶
Misc¶
Enabled testing on Python 3.10 Removed async_lru dependency (is incompatible with Python 3.10) and replaced usage with protected property #719
Converted README.md to README.rst and use it as base file for docs #725
Rework filters resolving:
Automatically apply Bound Filters with default values to handlers
Fix data transfer from parent to included routers filters
Added full support of Bot API 5.4 https://core.telegram.org/bots/api-changelog#november-5-2021 #744
3.0.0a17 (2021-09-24)¶
Misc¶
3.0.0a16 (2021-09-22)¶
Features¶
Misc¶
Covered by tests and docs KeyboardBuilder util #699
Breaking!!!. Refactored and renamed exceptions.
Exceptions module was moved from
aiogram.utils.exceptions
toaiogram.exceptions
Added prefix Telegram for all error classes
Replaced all
pragma: no cover
marks via global.coveragerc
config #702Updated dependencies.
Breaking for framework developers Now all optional dependencies should be installed as extra: poetry install -E fast -E redis -E proxy -E i18n -E docs #703
3.0.0a15 (2021-09-10)¶
Features¶
Ability to iterate over all states in StatesGroup. Aiogram already had in check for states group so this is relative feature. #666
Bugfixes¶
Fixed incorrect type checking in the
aiogram.utils.keyboard.KeyboardBuilder
#674
Misc¶
3.0.0a14 (2021-08-17)¶
Features¶
Bugfixes¶
Prepare parse mode for InputMessageContent in AnswerInlineQuery method #660
Improved Documentation¶
Added integration with
towncrier
#602
Misc¶
2.14.3 (2021-07-21)¶
2.14.2 (2021-07-26)¶
2.14 (2021-07-27)¶
Fixed
Message.send_copy
method for polls (#603)Updated pattern for
GroupDeactivated
exception (#549Added
caption_entities
field inInputMedia
base class (#583)Fixed HTML text decorations for tag
pre
(#597 fixes issues #596 and #481)Fixed
Message.get_full_command
method for messages with caption (#576)Improved
MongoStorage
: remove documents with empty data fromaiogram_data
collection to save memory. (#609)
2.13 (2021-04-28)¶
Added full support of Bot API 5.2 (#572)
Fixed usage of
provider_data
argument insendInvoice
method callAllowed to use State instances FSM storage directly (#542)
Added possibility to get i18n locale without User instance (#546)
Fixed returning type of
Bot.*_chat_invite_link()
methods #548 (#549)Fixed deep-linking util (#569)
Small changes in documentation - describe limits in docstrings corresponding to the current limit. (#565)
Fixed internal call to deprecated ‘is_private’ method (#553)
Added possibility to use
allowed_updates
argument in Polling mode (#564)
2.12.1 (2021-03-22)¶
Fixed
TypeError: Value should be instance of 'User' not 'NoneType'
(#527)Added missing
Chat.message_auto_delete_time
field (#535)Added
MediaGroup
filter (#528)Added
Chat.delete_message
shortcut (#526)Added mime types parsing for
aiogram.types.Document
(#431)Added warning in
TelegramObject.__setitem__
when Telegram adds a new field (#532)Fixed
examples/chat_type_filter.py
(#533)Removed redundant definitions in framework code (#531)
2.12 (2021-03-14)¶
Full support for Telegram Bot API 5.1 (#519)
Fixed sending playlist of audio files and documents (#465, #468)
Fixed
FSMContextProxy.setdefault
method (#491)Fixed
Message.answer_location
andMessage.reply_location
unable to send live location (#497)Fixed
user_id
andchat_id
getters from the context at Dispatchercheck_key
,release_key
andthrottle
methods (#520)Fixed
Chat.update_chat
method and all similar situations (#516)Fixed
MediaGroup
attach methods (#514)Fixed state filter for inline keyboard query callback in groups (#508, #510)
Added missing
ContentTypes.DICE
(#466)Added missing vcard argument to
InputContactMessageContent
constructor (#473)Add missing exceptions:
MessageIdInvalid
,CantRestrictChatOwner
andUserIsAnAdministratorOfTheChat
(#474, #512)Added
answer_chat_action
to theMessage
object (#501)Added dice to
message.send_copy
method (#511)Removed deprecation warning from
Message.send_copy
Added an example of integration between externally created aiohttp Application and aiogram (#433)
Added
split_separator
argument tosafe_split_text
(#515)Fixed some typos in docs and examples (#489, #490, #498, #504, #514)
2.11.2 (2021-11-10)¶
Fixed default parse mode
Added missing “supports_streaming” argument to answer_video method #462
2.11.1 (2021-11-10)¶
2.11 (2021-11-08)¶
Added full support of Telegram Bot API 5.0 (#454)
- Added possibility to more easy specify custom API Server (example)
WARNING: API method
close
was named in Bot class as close_bot in due to Bot instance already has method with the same name. It will be changed inaiogram 3.0
Added alias to Message object
Message.copy_to
with deprecation ofMessage.send_copy
ChatType.SUPER_GROUP
renamed toChatType.SUPERGROUP
(#438)
2.10.1 (2021-09-14)¶
Fixed critical bug with getting asyncio event loop in executor. (#424)
AttributeError: 'NoneType' object has no attribute 'run_until_complete'
2.10 (2021-09-13)¶
Breaking change: Stop using _MainThread event loop in bot/dispatcher instances (#397)
Fixed: TelegramObject’s aren’t destroyed after update handling #307 (#371)
Add setting current context of Telegram types (#369)
Fixed markdown escaping issues (#363)
Fixed HTML characters escaping (#409)
Fixed italic and underline decorations when parse entities to Markdown
Added missing thumb parameter (#362)
Added public methods to register filters and middlewares (#370)
Added ChatType builtin filter (#356)
Fixed IDFilter checking message from channel (#376)
Added missed answer_poll and reply_poll (#384)
Added possibility to ignore message caption in commands filter (#383)
Fixed addStickerToSet method
Added preparing thumb in send_document method (#391)
Added exception MessageToPinNotFound (#404)
Fixed handlers parameter-spec solving (#408)
Fixed CallbackQuery.answer() returns nothing (#420)
CHOSEN_INLINE_RESULT is a correct API-term (#415)
Fixed missing attributes for Animation class (#422)
Added missed emoji argument to reply_dice (#395)
Added is_chat_creator method to ChatMemberStatus (#394)
Added missed ChatPermissions to __all__ (#393)
Added is_forward method to Message (#390)
Fixed usage of deprecated is_private function (#421)
and many others documentation and examples changes:
Updated docstring of RedisStorage2 (#423)
Updated I18n example (added docs and fixed typos) (#419)
A little documentation revision (#381)
Added comments about correct errors_handlers usage (#398)
Fixed typo rexex -> regex (#386)
Fixed docs Quick start page code blocks (#417)
fixed type hints of callback_data (#400)
Prettify readme, update downloads stats badge (#406)
2.9.2 (2021-06-13)¶
2.9 (2021-06-08)¶
Added full support of Telegram Bot API 4.9
Fixed user context at poll_answer update (#322)
Fix Chat.set_description (#325)
Add lazy session generator (#326)
Fix missing
InlineQueryResultPhoto
parse_mode
field (#331)Fix fields from parent object in
KeyboardButton
(#344 fixes #343)Add possibility to get bot id without calling
get_me
(#296)
2.8 (2021-04-26)¶
Added full support of Bot API 4.8
Added
Message.answer_dice
andMessage.reply_dice
methods (#306)
2.7 (2021-04-07)¶
2.6.1 (2021-01-25)¶
2.6 (2021-01-23)¶
2.5.3 (2021-01-05)¶
2.5.2 (2021-01-01)¶
Get back
quote_html
andescape_md
functions
2.5.1 (2021-01-01)¶
Hot-fix of
CommandStart
filter
2.5 (2021-01-01)¶
#239 Fixed
check_token
method#248 Fixed support of aiohttp-socks
Updated setup.py. No more use of internal pip API
Updated links to documentations (https://docs.aiogram.dev)
Other small changes and minor improvements (#223 and others…)
2.4 (2021-10-29)¶
Added Message.send_copy method (forward message without forwarding)
Safe close of aiohttp client session (no more exception when application is shutdown)
No more “adWanced” words in project #209
Arguments user and chat is renamed to user_id and chat_id in Dispatcher.throttle method #196
Fixed set_chat_permissions #198
Fixed Dispatcher polling task does not process cancellation #199, #201
Fixed compatibility with latest asyncio version #200
Disabled caching by default for lazy_gettext method of I18nMiddleware #203
Fixed HTML user mention parser #205
Added IsReplyFilter #210
Fixed send_poll method arguments #211
Added OrderedHelper #215
Fix incorrect completion order. #217
2.3 (2021-08-16)¶
Full support of Telegram Bot API 4.4
Fixed #143
Added expire argument to RedisStorage2 and other storage fixes #145
Fixed JSON and Pickle storages #138
Implemented MongoStorage #153 based on aiomongo (soon motor will be also added)
Improved tests
Updated examples
Warning: Updated auth widget util. #190
Implemented throttle decorator #181
2.2 (2021-06-09)¶
2.1 (2021-04-18)¶
Implemented all new features from Telegram Bot API 4.2
is_member
andis_admin
methods ofChatMember
andChatMemberStatus
was renamed tois_chat_member
andis_chat_admin
Remover func filter
Added some useful Message edit functions (
Message.edit_caption
,Message.edit_media
,Message.edit_reply_markup
) (#121, #103, #104, #112)Added requests timeout for all methods (#110)
Added
answer*
methods toMessage
object (#112)Maked some improvements of
CallbackData
factoryAdded deep-linking parameter filter to
CommandStart
filterImplemented logging filter for extending LogRecord attributes (Will be usefull with external logs collector utils like GrayLog, Kibana and etc.)
Updated
requirements.txt
anddev_requirements.txt
filesOther small changes and minor improvements
2.0.1 (2021-12-31)¶
2.0 (2021-10-28)¶
This update will break backward compability with Python 3.6 and works only with Python 3.7+: - contextvars (PEP-567); - New syntax for annotations (PEP-563).
Changes:
- Used contextvars instead of aiogram.utils.context
;
- Implemented filters factory;
- Implemented new filters mechanism;
- Allowed to customize command prefix in CommandsFilter;
- Implemented mechanism of passing results from filters (as dicts) as kwargs in handlers (like fixtures in pytest);
- Implemented states group feature;
- Implemented FSM storage’s proxy;
- Changed files uploading mechanism;
- Implemented pipe for uploading files from URL;
- Implemented I18n Middleware;
- Errors handlers now should accept only two arguments (current update and exception);
- Used aiohttp_socks
instead of aiosocksy
for Socks4/5 proxy;
- types.ContentType was divided to types.ContentType
and types.ContentTypes
;
- Allowed to use rapidjson instead of ujson/json;
- .current()
method in bot and dispatcher objects was renamed to get_current()
;
Full changelog - You can read more details about this release in migration FAQ: https://aiogram.readthedocs.io/en/latest/migration_1_to_2.html
1.4 (2021-08-03)¶
Bot API 4.0 (#57)
1.3.3 (2021-07-16)¶
Fixed markup-entities parsing;
Added more API exceptions;
Now InlineQueryResultLocation has live_period;
Added more message content types;
Other small changes and minor improvements.
1.3.2 (2021-05-27)¶
Fixed crashing of polling process. (i think)
Added parse_mode field into input query results according to Bot API Docs.
Warning: disabled connections limit for bot aiohttp session.
Warning: Destroyed “temp sessions” mechanism.
Added new error types.
Refactored detection of error type.
Small fixes of executor util.
Fixed RethinkDBStorage
1.3.1 (2018-05-27)¶
1.3 (2021-04-22)¶
Allow to use Socks5 proxy (need manually install
aiosocksy
).Refactored
aiogram.utils.executor
module.[Warning] Updated requirements list.
1.2.3 (2018-04-14)¶
Fixed API errors detection
Fixed compability of
setup.py
with pip 10.0.0
1.2.2 (2018-04-08)¶
Added more error types.
Implemented method
InputFile.from_url(url: str)
for downloading files.Implemented big part of API method tests.
Other small changes and mminor improvements.
1.2.1 (2018-03-25)¶
1.2 (2018-02-23)¶
Full provide Telegram Bot API 3.6
Fixed critical error:
Fatal Python error: PyImport_GetModuleDict: no module dictionary!
Implemented connection pool in RethinkDB driver
Typo fixes of documentstion
Other bug fixes and minor improvements.
1.1 (2018-01-27)¶
Added more methods for data types (like
message.reply_sticker(...)
orfile.download(...)
Typo fixes of documentstion
Allow to set default parse mode for messages (
Bot( ... , parse_mode='HTML')
)Allowed to cancel event from the
Middleware.on_pre_process_<event type>
Fixed sending files with correct names.
Fixed MediaGroup
Added RethinkDB storage for FSM (
aiogram.contrib.fsm_storage.rethinkdb
)
1.0.4 (2018-01-10)¶
1.0.3 (2018-01-07)¶
Added middlewares mechanism.
Added example for middlewares and throttling manager.
Added logging middleware (
aiogram.contrib.middlewares.logging.LoggingMiddleware
)Fixed handling errors in async tasks (marked as ‘async_task’)
Small fixes and other minor improvements.
1.0.2 (2017-11-29)¶
1.0.1 (2017-11-21)¶
Implemented
types.InputFile
for more easy sending local filesDanger! Fixed typo in word pooling. Now whatever all methods with that word marked as deprecated and original methods is renamed to polling. Check it in you’r code before updating!
Fixed helper for chat actions (
types.ChatActions
)Added example for media group.
1.0 (2017-11-19)¶
Remaked data types serialozation/deserialization mechanism (Speed up).
Fully rewrited all Telegram data types.
Bot object was fully rewritted (regenerated).
Full provide Telegram Bot API 3.4+ (with sendMediaGroup)
Warning: Now
BaseStorage.close()
is awaitable! (FSM)Fixed compability with uvloop.
More employments for
aiogram.utils.context
.Allowed to disable
ujson
.Other bug fixes and minor improvements.
Migrated from Bitbucket to Github.