Skip to content

Latest commit

 

History

History
637 lines (463 loc) · 22.9 KB

CHANGES.rst

File metadata and controls

637 lines (463 loc) · 22.9 KB

Changelog

.. towncrier-draft-entries:: |release| [UNRELEASED DRAFT]

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 :obj:`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 ":ref:`Combining filters <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 :class:`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

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