Changelog

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.

    #1589

  • 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 the business_connection_id as a parameter, instead directly accessing it from the instance attributes. #1586

Features

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

  • Increase max pydantic version support “<2.9” -> “<2.10” (only For Python >=3.9) #1576

  • Bump aiofiles version upper bound to <24.2 #1577

Bugfixes

  • Fixed Default object annotation resolution using pydantic #1579

3.13.0 (2024-09-08)

Features

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

Misc

  • Improved performance of StatesGroup #1507

3.11.0 (2024-08-09)

Features

Bugfixes

  • Fixed URL path in the “Open” button at the “demo/sendMessage” endpoint in the web_app example. #1546

Misc

3.10.0 (2024-07-07)

Features

3.9.0 (2024-07-06)

Features

Bugfixes

  • Fixed event context resolving for the callback query that is coming from the business account #1520

3.8.0 (2024-06-19)

Features

Bugfixes

  • Increased DNS cache ttl setting to aiohttp session as a workaround for DNS resolution issues in aiohttp. #1500

Improved Documentation

  • Fixed MongoStorage section in the documentation by adding extra dependency to ReadTheDocs configuration. #1501

  • Added information about dependency changes to the 2.x --> 3.x migration guide. #1504

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:

    1. developer breaks RedisStorage and/or MongoStorage code

    2. tests are run with incorrect redis and/or mongo URIsprovided by “–redis” and “–mongo” options (for example, wrong port specified)

    3. tests pass because skipping doesn’t fail tests run

    4. developer or reviewer doesn’t notice that redis and/or mongo tests were skipped

    5. 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 (using motor library) #1434

  • Added full support of Bot API 7.4 #1498

Bugfixes

  • Fixed wrong MarkdownV2 custom emoji parsing in aiogram.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

Improved Documentation

  • Added telegram objects transformation block in 2.x -> 3.x migration guide #1412

3.5.0 (2024-04-23)

Features

  • Added message_thread_id parameter to ChatActionSender class methods. #1437

  • Added context manager interface to Bot instance, from now you can use:

    async with Bot(...) as bot:
        ...
    

    instead of

    async with Bot(...).context() as bot:
        ...
    

    #1468

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.

    #1424

  • Fixed poll answer FSM context by handling voter_chat for poll_answer event #1436

  • Added missing error handling to _background_feed_update (when in handle_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.

    #1392

  • A new enum KeyboardButtonPollTypeType for KeyboardButtonPollTypeType.type field has bed added. #1398

  • Added 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 field boost_added to the class Message for service messages about a user boosting a chat.

    • Added the field sender_boost_count to the class Message.

    • Added the field reply_to_story to the class Message.

    • Added the fields chat and id to the class Story.

    • Added the field unrestrict_boost_count to the class Chat.

    • Added the field custom_emoji_sticker_set_name to the class Chat.

    #1417

Bugfixes

  • Update KeyboardBuilder utility, fixed type-hints for button method, adjusted limits of the different markup types to real world values. #1399

  • Added new reply_parameters param to message.send_copy because it hasn’t been added there #1403

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

    #1387

3.2.0 (2023-11-24)

Features

  • Introduced Scenes feature that helps you to simplify user interactions using Finite State Machine. Read more about 👉 Scenes. #1280

  • Added the new FSM strategy CHAT_TOPIC, which sets the state for the entire topic in the chat, also works in private messages and regular groups without topics. #1343

Bugfixes

  • Fixed parse_mode argument in the in Message.send_copy shortcut. Disable by default. #1332

  • Added ability to get handler flags from filters. #1360

  • Fixed a situation where a CallbackData could not be parsed without a default value. #1368

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 from RedisStorage #1320

  • Updated dependencies, bumped minimum required version:

    • magic-filter - fixed .resolve operation

    • pydantic - fixed compatibility (broken in 2.4)

    • aiodns - added new dependency to the fast extras (pip install aiogram[fast])

    • others…

    #1327

  • 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 with FastAPI #1347

  • Introduce 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. #1361

  • Updated thumbnail fields type to InputFile 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. #1293

  • Added full support of Bot API 6.9 #1319

Bugfixes

  • Added actual param hints for InlineKeyboardBuilder and ReplyKeyboardBuilder. #1303

  • Fixed priority of events isolation, now user state will be loaded only after lock is acquired #1317

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. #1277

  • Fixed magic .as_(...) operation for values that can be interpreted as False (e.g. 0). #1281

  • Italic markdown from utils now uses correct decorators #1282

  • Fixed method Message.send_copy for stickers. #1284

  • Fixed Message.send_copy method, which was not working properly with stories, so not you can copy stories too (forwards messages). #1286

  • Fixed 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) #1252

  • Fixed 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,
        ...
    )
    

    #1194

  • 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

  • Fixed polling startup when “bot” key is passed manually into dispatcher workflow data #1242

  • Added codegen configuration for lost shortcuts:

    • ShippingQuery.answer

    • PreCheckoutQuery.answer

    • Message.delete_reply_markup

    #1244

Improved Documentation

  • Added documentation for webhook and polling modes. #1241

Misc

  • Reworked InputFile reading, removed __aiter__ method, added bot: Bot argument to the .read(...) method, so, from now URLInputFile can be used without specifying bot instance. #1238

  • Code-generated __init__ typehints in types and methods to make IDE happy without additional pydantic plugin #1245

3.0.0b9 (2023-07-30)

Features

Bugfixes

  • Fixed bot assignment in the Message.send_copy shortcut #1232

  • Added 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

    #1161

  • Improved CallbackData serialization.

    • Minimized UUID (hex without dashes)

    • Replaced bool values with int (true=1, false=0)

    #1163

  • 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 #1173

  • Made allowed_updates list to revolve automatically in start_polling method if not set explicitly. #1178

  • Added possibility to pass custom headers to URLInputFile object #1191

Bugfixes

  • Change type of result in InlineQueryResult enum for InlineQueryResultCachedMpeg4Gif and InlineQueryResultMpeg4Gif to more correct according to documentation.

    Change regexp for entities parsing to more correct (InlineQueryResultType.yml). #1146

  • Fixed signature of startup/shutdown events to include the **dispatcher.workflow_data as the handler arguments. #1155

  • Added missing FORUM_TOPIC_EDITED value to content_type property #1160

  • Fixed 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.

    #1139

  • 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.

    #1168

  • Updated Pydantic to V2

    Warning

    Be careful, not all libraries is already updated to using V2

    #1202

  • Added global defaults disable_web_page_preview and protect_content in addition to parse_mode to the Bot instance, reworked internal request builder mechanism. #1142

  • Removed 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

    #1210

  • Updated magic-filter with new features

    • Added hint for len(F) error

    • Added not in operation

    #1221

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

Bugfixes

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 no can_send_media_messages attribute

    #1112

  • Replaced error TypeError: TelegramEventObserver.__call__() got an unexpected keyword argument '<name>' with a more understandable one for developers and with a link to the documentation. #1114

  • Added 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()

    #1030

  • Added following methods to User class:

    • User.mention_markdown(...)

    • User.mention_html(...)

    #1049

  • Added full support of Bot API 6.3 #1057

Bugfixes

  • Fixed Message.send_invoice and Message.reply_invoice, added missing arguments #1047

  • Fixed copy and forward in:

    • Message.answer(...)

    • Message.copy_to(...)

    #1064

Improved Documentation

  • Fixed UA translations in index.po #1017

  • Fix typehints for Message, reply_media_group and answer_media_group methods #1029

  • Removed an old now non-working feature #1060

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. #898

  • Fixed 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')
    

    #894

  • 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

    #906

  • 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)

    #938

  • Removed deprecated router.<event>_handler and router.register_<event>_handler methods. #941

  • Deprecated 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

Bugfixes

  • Fixed I18n lazy-proxy. Disabled caching. #839

  • Added parsing of spoiler message entity #865

  • Fixed default parse_mode for Message.copy_to() method. #876

  • Fixed CallbackData factory parsing IntEnum’s #885

Misc

  • Added automated check that pull-request adds a changes description to CHANGES directory #873

  • Changed Message.html_text and Message.md_text attributes behaviour when message has no text. The empty string will be used instead of raising error. #874

  • Used 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

  • Fixed unexpected behavior of sequences in the StateFilter. #791

  • Fixed exceptions filters #827

Misc

  • Logger name for processing events is changed to aiogram.events. #830

  • Added full support of Telegram Bot API 5.6 and 5.7 #835

  • BREAKING Events isolation mechanism is moved from FSM storages to standalone managers #838

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)
    

    #759

Bugfixes

  • Fixed: Missing ChatMemberHandler import in aiogram/dispatcher/handler #751

Misc

  • Check destiny in case of no with_destiny enabled in RedisStorage key builder #776

  • Added 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)
    

    #717

  • 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 filters

    For 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)
    ...
    

    #724

Bugfixes

  • Fixed I18n context inside error handlers #726

  • Fixed bot session closing before emit shutdown #734

  • Fixed: bound filter resolving does not require children routers #736

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

    #727

  • 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

  • Added html_text and md_text to Message object #708

  • Refactored I18n, added context managers for I18n engine and current locale #709

3.0.0a16 (2021-09-22)

Features

  • Added support of local Bot API server files downloading

    When Local API is enabled files can be downloaded via bot.download/bot.download_file methods. #698

  • Implemented I18n & L10n support #701

Misc

  • Covered by tests and docs KeyboardBuilder util #699

  • Breaking!!!. Refactored and renamed exceptions.

    • Exceptions module was moved from aiogram.utils.exceptions to aiogram.exceptions

    • Added prefix Telegram for all error classes

    #700

  • Replaced all pragma: no cover marks via global .coveragerc config #702

  • Updated 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

  • Disable ContentType filter by default #668

  • Moved update type detection from Dispatcher to Update object #669

  • Updated pre-commit config #681

  • Reworked handlers_in_use util. Function moved to Router as method .resolve_used_update_types() #682

3.0.0a14 (2021-08-17)

Features

  • add aliases for edit/delete reply markup to Message #662

  • Reworked outer middleware chain. Prevent to call many times the outer middleware for each nested router #664

Bugfixes

  • Prepare parse mode for InputMessageContent in AnswerInlineQuery method #660

Improved Documentation

  • Added integration with towncrier #602

Misc

  • Added .editorconfig #650

  • Redis storage speedup globals #651

  • add allow_sending_without_reply param to Message reply aliases #663

2.14.3 (2021-07-21)

  • Fixed ChatMember type detection via adding customizable object serialization mechanism (#624, #623)

2.14.2 (2021-07-26)

  • Fixed MemoryStorage cleaner (#619)

  • Fixed unused default locale in I18nMiddleware (#562, #563)

2.14 (2021-07-27)

  • Full support of Bot API 5.3 (#610, #614)

  • Fixed Message.send_copy method for polls (#603)

  • Updated pattern for GroupDeactivated exception (#549

  • Added caption_entities field in InputMedia 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 from aiogram_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 in sendInvoice method call

  • Fixed builtin command filter args (#556) (#558)

  • Allowed 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 and Message.reply_location unable to send live location (#497)

  • Fixed user_id and chat_id getters from the context at Dispatcher check_key, release_key and throttle 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 and UserIsAnAdministratorOfTheChat (#474, #512)

  • Added answer_chat_action to the Message 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 to safe_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)

  • Fixed files URL template

  • Fix MessageEntity serialization for API calls #457

  • When entities are set, default parse_mode become disabled (#461)

  • Added parameter supports_streaming to reply_video, remove redundant docstrings (#459)

  • Added missing parameter to promoteChatMember alias (#458)

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 in aiogram 3.0

  • Added alias to Message object Message.copy_to with deprecation of Message.send_copy

  • ChatType.SUPER_GROUP renamed to ChatType.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)

  • Breaking change: Replaced aiomongo with motor (#368, #380)

  • 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

  • Fixed #413: parse entities positioning (#414)

  • 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)

  • Fixed Message.get_full_command() #352

  • Fixed markdown util #353

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 text decorations (#315, #316, #328)

  • 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 and Message.reply_dice methods (#306)

2.7 (2021-04-07)

  • Added full support of Bot API 4.7 (#294 #289)

  • Added default parse mode for send_animation method (#293 #292)

  • Added new API exception when poll requested in public chats (#270)

  • Make correct User and Chat get_mention methods (#277)

  • Small changes and other minor improvements

2.6.1 (2021-01-25)

  • Fixed reply KeyboardButton initializer with request_poll argument (#266)

  • Added helper for poll types (aiogram.types.PollType)

  • Changed behavior of Telegram_object .as_* and .to_* methods. It will no more mutate the object. (#247)

2.6 (2021-01-23)

  • Full support of Telegram Bot API v4.6 (Polls 2.0) #265

  • Aded new filter - IsContactSender (commit)

  • Fixed proxy extra dependencies version #262

2.5.3 (2021-01-05)

  • #255 Updated CallbackData factory validity check. More correct for non-latin symbols

  • #256 Fixed renamed_argument decorator error

  • #257 One more fix of CommandStart filter

2.5.2 (2021-01-01)

  • Get back quote_html and escape_md functions

2.5.1 (2021-01-01)

  • Hot-fix of CommandStart filter

2.5 (2021-01-01)

  • Added full support of Telegram Bot API 4.5 (#250, #251)

  • #239 Fixed check_token method

  • #238, #241: Added deep-linking utils

  • #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 new filters from issue #151: #172, #176, #182

  • 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)

  • Provides latest Telegram Bot API (4.3)

  • Updated docs for filters

  • Added opportunity to use different bot tokens from single bot instance (via context manager, #100)

  • IMPORTANT: Fixed Typo: data -> bucket in update_bucket for RedisStorage2 (#132)

2.1 (2021-04-18)

  • Implemented all new features from Telegram Bot API 4.2

  • is_member and is_admin methods of ChatMember and ChatMemberStatus was renamed to is_chat_member and is_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 to Message object (#112)

  • Maked some improvements of CallbackData factory

  • Added deep-linking parameter filter to CommandStart filter

  • Implemented opportunity to use DNS over socks (#97 -> #98)

  • Implemented logging filter for extending LogRecord attributes (Will be usefull with external logs collector utils like GrayLog, Kibana and etc.)

  • Updated requirements.txt and dev_requirements.txt files

  • Other small changes and minor improvements

2.0.1 (2021-12-31)

  • Implemented CallbackData factory (example)

  • Implemented methods for answering to inline query from context and reply with animation to the messages. #85

  • Fixed installation from tar.gz #84

  • More exceptions (ChatIdIsEmpty and NotEnoughRightsToRestrict)

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.

  • Added new methods for Chat object. (#42, #43)

  • 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)

  • Fixed handling Venue’s [#27, #26]

  • Added parse_mode to all medias (Bot API 3.6 support) [#23]

  • Now regexp filter can be used with callback query data [#19]

  • Improvements in InlineKeyboardMarkup & ReplyKeyboardMarkup objects [#21]

  • Other bug & typo fixes and minor improvements.

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(...) or file.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 files

  • Danger! 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.

0.4.1 (2017-08-03)

0.4 (2017-08-05)

0.3.4 (2017-08-04)

0.3.3 (2017-07-05)

0.3.2 (2017-07-04)

0.3.1 (2017-07-04)

0.2b1 (2017-06-00)

0.1 (2017-06-03)