# SOME DESCRIPTIVE TITLE. # Copyright (C) 2023, aiogram Team # This file is distributed under the same license as the aiogram package. # FIRST AUTHOR , 2023. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: aiogram \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-30 18:31+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.12.1\n" #: ../../migration_2_to_3.rst:3 msgid "Migration FAQ (2.x -> 3.0)" msgstr "" #: ../../migration_2_to_3.rst:7 msgid "This guide is still in progress." msgstr "" #: ../../migration_2_to_3.rst:9 msgid "" "This version introduces much many breaking changes and architectural " "improvements, helping to reduce global variables count in your code, " "provides useful mechanisms to separate your code to modules or just make " "sharable modules via packages on the PyPi, makes middlewares and filters " "more controllable and others." msgstr "" #: ../../migration_2_to_3.rst:14 msgid "" "On this page you can read about points that changed corresponding to last" " stable 2.x version." msgstr "" #: ../../migration_2_to_3.rst:18 msgid "" "This page is most like a detailed changelog than a migration guide, but " "it will be updated in the future." msgstr "" #: ../../migration_2_to_3.rst:21 msgid "" "Feel free to contribute to this page, if you find something that is not " "mentioned here." msgstr "" #: ../../migration_2_to_3.rst:25 msgid "Dispatcher" msgstr "" #: ../../migration_2_to_3.rst:27 msgid "" ":class:`Dispatcher` class no longer accepts the `Bot` instance into the " "initializer, it should be passed to dispatcher only for starting polling " "or handling event from webhook. Also this way adds possibility to use " "multiple bot instances at the same time (\"multibot\")" msgstr "" #: ../../migration_2_to_3.rst:30 msgid "" ":class:`Dispatcher` now can be extended with another Dispatcher-like " "thing named :class:`Router` (:ref:`Read more » `). With " "routes you can easily separate your code to multiple modules and may be " "share this modules between projects." msgstr "" #: ../../migration_2_to_3.rst:34 msgid "" "Removed the **_handler** suffix from all event handler decorators and " "registering methods. (:ref:`Read more » `)" msgstr "" #: ../../migration_2_to_3.rst:36 msgid "" "Executor entirely removed, now you can use Dispatcher directly to start " "polling or webhook." msgstr "" #: ../../migration_2_to_3.rst:37 msgid "" "Throttling method is completely removed, now you can use middlewares to " "control the execution context and use any throttling mechanism you want." msgstr "" #: ../../migration_2_to_3.rst:39 msgid "" "Removed global context variables from the API types, Bot and Dispatcher " "object, from now if you want to get current bot instance inside handlers " "or filters you should accept the argument :code:`bot: Bot` and use it " "instead of :code:`Bot.get_current()` Inside middlewares it can be " "accessed via :code:`data[\"bot\"]`." msgstr "" #: ../../migration_2_to_3.rst:46 msgid "Filtering events" msgstr "" #: ../../migration_2_to_3.rst:48 msgid "" "Keyword filters can no more be used, use filters explicitly. (`Read more " "» `_)" msgstr "" #: ../../migration_2_to_3.rst:49 msgid "" "In due to keyword filters was removed all enabled by default filters " "(state and content_type now is not enabled), so you should specify them " "explicitly if you want to use. For example instead of using " ":code:`@dp.message_handler(content_types=ContentType.PHOTO)` you should " "use :code:`@router.message(F.photo)`" msgstr "" #: ../../migration_2_to_3.rst:53 msgid "" "Most of common filters is replaced by \"magic filter\". (:ref:`Read more " "» `)" msgstr "" #: ../../migration_2_to_3.rst:54 msgid "" "Now by default message handler receives any content type, if you want " "specific one just add the filters (Magic or any other)" msgstr "" #: ../../migration_2_to_3.rst:56 msgid "" "State filter now is not enabled by default, that's mean if you using " ":code:`state=\"*\"` in v2 then you should not pass any state filter in " "v3, and vice versa, if the state in v2 is not specified now you should " "specify the state." msgstr "" #: ../../migration_2_to_3.rst:59 msgid "" "Added possibility to register per-router global filters, that helps to " "reduces the number of repetitions in the code and makes easily way to " "control for what each router will be used." msgstr "" #: ../../migration_2_to_3.rst:65 msgid "Bot API" msgstr "" #: ../../migration_2_to_3.rst:67 msgid "" "Now all API methods is classes with validation (via `pydantic " "`_) (all API calls is also available as " "methods in the Bot class)." msgstr "" #: ../../migration_2_to_3.rst:69 msgid "" "Added more pre-defined Enums and moved into `aiogram.enums` sub-package. " "For example chat type enum now is :class:`aiogram.enums.ChatType` instead" " of :class:`aiogram.types.chat.ChatType`. (:ref:`Read more » `)" msgstr "" #: ../../migration_2_to_3.rst:72 msgid "" "Separated HTTP client session into container that can be reused between " "different Bot instances in the application." msgstr "" #: ../../migration_2_to_3.rst:74 msgid "" "API Exceptions is no more classified by specific message in due to " "Telegram has no documented error codes. But all errors is classified by " "HTTP status code and for each method only one case can be caused with the" " same code, so in most cases you should check that only error type (by " "status-code) without checking error message. (:ref:`Read more » `)" msgstr "" #: ../../migration_2_to_3.rst:81 msgid "Middlewares" msgstr "" #: ../../migration_2_to_3.rst:83 msgid "" "Middlewares can now control a execution context, e.g. using context " "managers (:ref:`Read more » `)" msgstr "" #: ../../migration_2_to_3.rst:84 msgid "" "All contextual data now is shared between middlewares, filters and " "handlers to end-to-end use. For example now you can easily pass some data" " into context inside middleware and get it in the filters layer as the " "same way as in the handlers via keyword arguments." msgstr "" #: ../../migration_2_to_3.rst:87 msgid "" "Added mechanism named **flags**, that helps to customize handler behavior" " in conjunction with middlewares. (:ref:`Read more » `)" msgstr "" #: ../../migration_2_to_3.rst:92 msgid "Keyboard Markup" msgstr "" #: ../../migration_2_to_3.rst:94 msgid "" "Now :class:`aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup` " "and :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup` has " "no methods to extend it, instead you have to use markup builders " ":class:`aiogram.utils.keyboard.ReplyKeyboardBuilder` and " ":class:`aiogram.utils.keyboard.KeyboardBuilder` respectively (:ref:`Read " "more » `)" msgstr "" #: ../../migration_2_to_3.rst:102 msgid "Callbacks data" msgstr "" #: ../../migration_2_to_3.rst:104 msgid "" "Callback data factory now is strictly typed via `pydantic " "`_ models (:ref:`Read more » `)" msgstr "" #: ../../migration_2_to_3.rst:109 msgid "Finite State machine" msgstr "" #: ../../migration_2_to_3.rst:111 msgid "" "State filter will no more added to all handlers, you will need to specify" " state if you want" msgstr "" #: ../../migration_2_to_3.rst:112 msgid "" "Added possibility to change FSM strategy, for example if you want to " "control state for each user in chat topics instead of user in chat you " "can specify it in the Dispatcher." msgstr "" #: ../../migration_2_to_3.rst:117 msgid "Sending Files" msgstr "" #: ../../migration_2_to_3.rst:119 msgid "" "From now you should wrap sending files into InputFile object before send " "instead of passing IO object directly to the API method. (:ref:`Read more" " » `)" msgstr "" #: ../../migration_2_to_3.rst:124 msgid "Webhook" msgstr "" #: ../../migration_2_to_3.rst:126 msgid "Simplified aiohttp web app configuration" msgstr "" #: ../../migration_2_to_3.rst:127 msgid "" "By default added possibility to upload files when you use reply into " "webhook" msgstr ""