Corrected grammatical errors, improved sentence structures, translation for migration 2.x-3.x (#1302)

* Corrected grammatical errors, improved sentence structures for clarity, added translation to migration_2_to_3.rst

* add changelog

* Update method name in docs for error handling

* Update migration_2_to_3.rst

Co-authored-by: Oleg A. <t0rr@mail.ru>

* Update migration_2_to_3.rst

Co-authored-by: Oleg A. <t0rr@mail.ru>

* Update migration_2_to_3.rst

Co-authored-by: Oleg A. <t0rr@mail.ru>

* Update docs/locale/uk_UA/LC_MESSAGES/api/methods/set_sticker_set_thumb.po

Co-authored-by: Oleg A. <t0rr@mail.ru>

* rollback unnecessary change for error attribute

---------

Co-authored-by: Oleg A. <t0rr@mail.ru>
This commit is contained in:
Kostiantyn Kriuchkov 2023-10-01 15:29:18 +03:00 committed by GitHub
parent eacea996d4
commit b5ef05c01a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 776 additions and 318 deletions

1
CHANGES/1302.doc Normal file
View file

@ -0,0 +1 @@
Corrected grammatical errors, improved sentence structures, translation for migration 2.x-3.x

View file

@ -3,19 +3,20 @@
# This file is distributed under the same license as the aiogram package. # This file is distributed under the same license as the aiogram package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022. # FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
# #
#, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: aiogram \n" "Project-Id-Version: aiogram\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-11 01:52+0200\n" "POT-Creation-Date: 2023-06-01 20:49+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2023-09-14 17:37+0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: \n"
"Language: uk\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.11.0\n" "Generated-By: Babel 2.12.1\n"
"X-Generator: Poedit 3.3.2\n"
#: ../../api/methods/set_sticker_set_thumb.rst:3 #: ../../api/methods/set_sticker_set_thumb.rst:3
msgid "setStickerSetThumb" msgid "setStickerSetThumb"
@ -23,15 +24,38 @@ msgstr ""
#: ../../api/methods/set_sticker_set_thumb.rst:5 #: ../../api/methods/set_sticker_set_thumb.rst:5
msgid "Returns: :obj:`bool`" msgid "Returns: :obj:`bool`"
msgstr "" msgstr "Повертає: :obj:`bool`"
#: aiogram.methods.set_sticker_set_thumb.SetStickerSetThumbnail:1 of
msgid "Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns :code:`True` on success."
msgstr "Використовуйте цей метод, щоб встановити мініатюру звичайного або маскового набору стікерів. Формат файлу мініатюри повинен відповідати формату стікерів у наборі. Повертає :code:`True` при успіху."
#: aiogram.methods.set_sticker_set_thumb.SetStickerSetThumbnail:3 of
msgid "Source: https://core.telegram.org/bots/api#setstickersetthumbnail"
msgstr "Джерело: https://core.telegram.org/bots/api#setstickersetthumbnail"
#: ../../docstring
#: aiogram.methods.set_sticker_set_thumb.SetStickerSetThumbnail.name:1 of
msgid "Sticker set name"
msgstr "Назва набору стікерів"
#: ../../docstring
#: aiogram.methods.set_sticker_set_thumb.SetStickerSetThumbnail.user_id:1 of
msgid "User identifier of the sticker set owner"
msgstr "Ідентифікатор користувача власника набору стікерів "
#: ../../docstring
#: aiogram.methods.set_sticker_set_thumb.SetStickerSetThumbnail.thumbnail:1 of
msgid "A **.WEBP** or **.PNG** image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a **.TGS** animation with a thumbnail up to 32 kilobytes in size (see `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for animated sticker technical requirements), or a **WEBM** video with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for video sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More information on Sending Files » <sending-files>`. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail."
msgstr "Зображення у форматі **.WEBP** або **.PNG** з мініатюрою має бути розміром до 128 кілобайт і мати ширину та висоту рівно 100 пікселів, або анімацією у форматі **.TGS** з мініатюрою розміром до 32 кілобайт (див. `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram. org/stickers#animated-sticker-requirements>`_ технічні вимоги до анімованих наліпок), або **WEBM** відео з мініатюрою розміром до 32 кілобайт; дивіться `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ технічні вимоги до відео наліпок. Передайте *file_id* як рядок, щоб надіслати файл, який вже існує на серверах Telegram, передайте HTTP URL як рядок, щоб Telegram отримав файл з Інтернету, або завантажте новий файл за допомогою мультичастини/форма-даних. :ref:`Додаткова інформація про надсилання файлів \" <sending-files>`. Ескізи анімованих і відео-наборів наклейок не можуть бути завантажені через HTTP URL. Якщо цей параметр не вказано, то мініатюру буде вилучено, а замість неї буде використано першу наліпку."
#: ../../api/methods/set_sticker_set_thumb.rst:14 #: ../../api/methods/set_sticker_set_thumb.rst:14
msgid "Usage" msgid "Usage"
msgstr "" msgstr "Використання"
#: ../../api/methods/set_sticker_set_thumb.rst:17 #: ../../api/methods/set_sticker_set_thumb.rst:17
msgid "As bot method" msgid "As bot method"
msgstr "" msgstr "Як метод в bot"
#: ../../api/methods/set_sticker_set_thumb.rst:25 #: ../../api/methods/set_sticker_set_thumb.rst:25
msgid "Method as object" msgid "Method as object"
@ -39,12 +63,10 @@ msgstr ""
#: ../../api/methods/set_sticker_set_thumb.rst:27 #: ../../api/methods/set_sticker_set_thumb.rst:27
msgid "Imports:" msgid "Imports:"
msgstr "" msgstr "Імпорти:"
#: ../../api/methods/set_sticker_set_thumb.rst:29 #: ../../api/methods/set_sticker_set_thumb.rst:29
msgid "" msgid ":code:`from aiogram.methods.set_sticker_set_thumb import SetStickerSetThumb`"
":code:`from aiogram.methods.set_sticker_set_thumb import "
"SetStickerSetThumb`"
msgstr "" msgstr ""
#: ../../api/methods/set_sticker_set_thumb.rst:30 #: ../../api/methods/set_sticker_set_thumb.rst:30
@ -53,11 +75,11 @@ msgstr ""
#: ../../api/methods/set_sticker_set_thumb.rst:33 #: ../../api/methods/set_sticker_set_thumb.rst:33
msgid "With specific bot" msgid "With specific bot"
msgstr "" msgstr "З конкретним bot"
#: ../../api/methods/set_sticker_set_thumb.rst:40 #: ../../api/methods/set_sticker_set_thumb.rst:40
msgid "As reply into Webhook in handler" msgid "As reply into Webhook in handler"
msgstr "" msgstr "Як відповідь у Webhook в обробнику"
#~ msgid "" #~ msgid ""
#~ "Use this method to set the " #~ "Use this method to set the "

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: aiogram\n" "Project-Id-Version: aiogram\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-26 23:17+0300\n" "POT-Creation-Date: 2023-09-14 17:21+0300\n"
"PO-Revision-Date: 2022-12-10 19:44+0200\n" "PO-Revision-Date: 2022-12-10 19:44+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -30,9 +30,10 @@ msgstr ""
"інших маршрутизаторів до диспетчера." "інших маршрутизаторів до диспетчера."
#: ../../dispatcher/dispatcher.rst:7 #: ../../dispatcher/dispatcher.rst:7
#, fuzzy
msgid "" msgid ""
"Here is only listed base information about Dispatcher. All about writing " "Here is only listed base information about Dispatcher. All about writing "
"handlers, filters and etc. you can found in next pages:" "handlers, filters and etc. you can find in next pages:"
msgstr "" msgstr ""
"Тут наведена лише базова інформація про диспетчер. Усе про написання " "Тут наведена лише базова інформація про диспетчер. Усе про написання "
"обробників, фільтрів і т.п. ви можете знайти на наступних сторінках:" "обробників, фільтрів і т.п. ви можете знайти на наступних сторінках:"
@ -142,7 +143,8 @@ msgid "contextual data"
msgstr "контекстні дані" msgstr "контекстні дані"
#: aiogram.dispatcher.dispatcher.Dispatcher.run_polling #: aiogram.dispatcher.dispatcher.Dispatcher.run_polling
#: aiogram.dispatcher.dispatcher.Dispatcher.start_polling of #: aiogram.dispatcher.dispatcher.Dispatcher.start_polling
#: aiogram.dispatcher.dispatcher.Dispatcher.stop_polling of
msgid "Returns" msgid "Returns"
msgstr "Повертає" msgstr "Повертає"
@ -161,6 +163,10 @@ msgid ""
"used update types are enabled (resolved from handlers)" "used update types are enabled (resolved from handlers)"
msgstr "" msgstr ""
#: aiogram.dispatcher.dispatcher.Dispatcher.stop_polling:1 of
msgid "Execute this method if you want to stop polling programmatically"
msgstr ""
#: ../../dispatcher/dispatcher.rst:18 #: ../../dispatcher/dispatcher.rst:18
msgid "Simple usage" msgid "Simple usage"
msgstr "Просте застосування" msgstr "Просте застосування"
@ -190,3 +196,4 @@ msgstr ""
#~ msgid "`Observer <observer.html>`__" #~ msgid "`Observer <observer.html>`__"
#~ msgstr "`Observer <observer.html>`__" #~ msgstr "`Observer <observer.html>`__"

View file

@ -5,100 +5,103 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: aiogram\n" "Project-Id-Version: aiogram\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-18 01:50+0300\n" "POT-Creation-Date: 2023-09-14 17:21+0300\n"
"PO-Revision-Date: 2022-10-25 15:53+0300\n" "PO-Revision-Date: 2022-10-25 15:53+0300\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n" "Generated-By: Babel 2.12.1\n"
"X-Generator: Poedit 3.1.1\n"
#: ../../dispatcher/filters/index.rst:3 #: ../../dispatcher/filters/index.rst:5
msgid "Filtering events" msgid "Filtering events"
msgstr "Фільтрування подій" msgstr "Фільтрування подій"
#: ../../dispatcher/filters/index.rst:5 #: ../../dispatcher/filters/index.rst:7
#, fuzzy
msgid "" msgid ""
"Filters is needed for routing updates to the specific handler. Searching of " "Filters is needed for routing updates to the specific handler. Searching "
"handler is always stops on first match set of filters are pass." "of handler is always stops on first match set of filters are pass. By "
"default, all handlers has empty set of filters, so all updates will be "
"passed to first handler that has empty set of filters."
msgstr "" msgstr ""
"Фільтри потрібні для маршрутизації оновлень до конкретного обробника " "Фільтри потрібні для маршрутизації оновлень до конкретного обробника "
"(handler) . Пошук обробника (handler) завжди зупиняється після першого збігу " "(handler) . Пошук обробника (handler) завжди зупиняється після першого "
"набору фільтрів." "збігу набору фільтрів."
#: ../../dispatcher/filters/index.rst:8
msgid "*aiogram* has some builtin useful filters."
msgstr "*aiogram* має декілька вбудованих корисних фільтрів."
#: ../../dispatcher/filters/index.rst:11 #: ../../dispatcher/filters/index.rst:11
#, fuzzy
msgid "*aiogram* has some builtin useful filters or you can write own filters."
msgstr "*aiogram* має декілька вбудованих корисних фільтрів."
#: ../../dispatcher/filters/index.rst:14
msgid "Builtin filters" msgid "Builtin filters"
msgstr "Вбудовані фільтри" msgstr "Вбудовані фільтри"
#: ../../dispatcher/filters/index.rst:13 #: ../../dispatcher/filters/index.rst:16
msgid "Here is list of builtin filters:" msgid "Here is list of builtin filters:"
msgstr "Ось список вбудованих фільтрів:" msgstr "Ось список вбудованих фільтрів:"
#: ../../dispatcher/filters/index.rst:27 #: ../../dispatcher/filters/index.rst:29
msgid "Writing own filters" msgid "Writing own filters"
msgstr "Написання власних фільтрів" msgstr "Написання власних фільтрів"
#: ../../dispatcher/filters/index.rst:29 #: ../../dispatcher/filters/index.rst:31
msgid "Filters can be:" msgid "Filters can be:"
msgstr "Фільтри бувають:" msgstr "Фільтри бувають:"
#: ../../dispatcher/filters/index.rst:31 #: ../../dispatcher/filters/index.rst:33
msgid "Asynchronous function (:code:`async def my_filter(*args, **kwargs): pass`)" msgid "Asynchronous function (:code:`async def my_filter(*args, **kwargs): pass`)"
msgstr "Асинхронною функцією (:code:`async def my_filter(*args, **kwargs): pass`)" msgstr "Асинхронною функцією (:code:`async def my_filter(*args, **kwargs): pass`)"
#: ../../dispatcher/filters/index.rst:32 #: ../../dispatcher/filters/index.rst:34
msgid "Synchronous function (:code:`def my_filter(*args, **kwargs): pass`)" msgid "Synchronous function (:code:`def my_filter(*args, **kwargs): pass`)"
msgstr "Синхронною функцією (:code:`def my_filter(*args, **kwargs): pass`)" msgstr "Синхронною функцією (:code:`def my_filter(*args, **kwargs): pass`)"
#: ../../dispatcher/filters/index.rst:33 #: ../../dispatcher/filters/index.rst:35
msgid "Anonymous function (:code:`lambda event: True`)" msgid "Anonymous function (:code:`lambda event: True`)"
msgstr "Анонімною функцією (:code:`lambda event: True`)" msgstr "Анонімною функцією (:code:`lambda event: True`)"
#: ../../dispatcher/filters/index.rst:34 #: ../../dispatcher/filters/index.rst:36
msgid "Any awaitable object" msgid "Any awaitable object"
msgstr "" msgstr ""
"Будь-яким очікуваним об'єктом (awaitable object, об'єкт, який може бути " "Будь-яким очікуваним об'єктом (awaitable object, об'єкт, який може бути "
"використаний в :code:`await` виразі)" "використаний в :code:`await` виразі)"
#: ../../dispatcher/filters/index.rst:35 #: ../../dispatcher/filters/index.rst:37
msgid "Subclass of :class:`aiogram.filters.base.Filter`" msgid "Subclass of :class:`aiogram.filters.base.Filter`"
msgstr "Підкласом :class:`aiogram.filters.base.Filter`" msgstr "Підкласом :class:`aiogram.filters.base.Filter`"
#: ../../dispatcher/filters/index.rst:36 #: ../../dispatcher/filters/index.rst:38
msgid "Instances of :ref:`MagicFilter <magic-filters>`" msgid "Instances of :ref:`MagicFilter <magic-filters>`"
msgstr "Екземпляром :ref:`MagicFilter <magic-filters>`" msgstr "Екземпляром :ref:`MagicFilter <magic-filters>`"
#: ../../dispatcher/filters/index.rst:38 #: ../../dispatcher/filters/index.rst:40
msgid "" msgid ""
"and should return bool or dict. If the dictionary is passed as result of filter " "and should return bool or dict. If the dictionary is passed as result of "
"- resulted data will be propagated to the next filters and handler as keywords " "filter - resulted data will be propagated to the next filters and handler"
"arguments." " as keywords arguments."
msgstr "" msgstr ""
"і має повертати bool або dict. Якщо словник передається як результат фільтра, " "і має повертати bool або dict. Якщо словник передається як результат "
"отримані дані будуть передані до наступних фільтрів і обробника як аргументи " "фільтра, отримані дані будуть передані до наступних фільтрів і обробника "
"ключових слів." "як аргументи ключових слів."
#: ../../dispatcher/filters/index.rst:43 #: ../../dispatcher/filters/index.rst:45
msgid "Base class for own filters" msgid "Base class for own filters"
msgstr "Базовий клас для власних фільтрів" msgstr "Базовий клас для власних фільтрів"
#: aiogram.filters.base.Filter:1 of #: aiogram.filters.base.Filter:1 of
msgid "" msgid ""
"If you want to register own filters like builtin filters you will need to write " "If you want to register own filters like builtin filters you will need to"
"subclass of this class with overriding the :code:`__call__` method and adding " " write subclass of this class with overriding the :code:`__call__` method"
"filter attributes." " and adding filter attributes."
msgstr "" msgstr ""
"Якщо Ви хочете зареєструвати власні фільтри, як вбудовані фільтри, Вам потрібно " "Якщо Ви хочете зареєструвати власні фільтри, як вбудовані фільтри, Вам "
"буде написати підклас цього класу з заміною методу :code:`__call__` і " "потрібно буде написати підклас цього класу з заміною методу "
"додаванням атрибутів фільтра." ":code:`__call__` і додаванням атрибутів фільтра."
#: aiogram.filters.base.Filter.__call__:1 of #: aiogram.filters.base.Filter.__call__:1 of
msgid "This method should be overridden." msgid "This method should be overridden."
@ -118,72 +121,78 @@ msgstr ":class:`bool` or :class:`Dict[str, Any]`"
#: aiogram.filters.base.Filter.update_handler_flags:1 of #: aiogram.filters.base.Filter.update_handler_flags:1 of
msgid "" msgid ""
"Also if you want to extend handler flags with using this filter you should " "Also if you want to extend handler flags with using this filter you "
"implement this method" "should implement this method"
msgstr "" msgstr ""
"Крім того, якщо ви хочете розширити маркери обробника (handler) за допомогою " "Крім того, якщо ви хочете розширити маркери обробника (handler) за "
"цього фільтра, вам слід реалізувати цей метод" "допомогою цього фільтра, вам слід реалізувати цей метод"
#: aiogram.filters.base.Filter.update_handler_flags of #: aiogram.filters.base.Filter.update_handler_flags of
msgid "Parameters" msgid "Parameters"
msgstr "Параметри" msgstr "Параметри"
#: aiogram.filters.base.Filter.update_handler_flags:3 of #: aiogram.filters.base.Filter.update_handler_flags:4 of
msgid "existing flags, can be updated directly" msgid "existing flags, can be updated directly"
msgstr "існуючі маркери, можна оновити безпосередньо" msgstr "існуючі маркери, можна оновити безпосередньо"
#: ../../dispatcher/filters/index.rst:51 #: ../../dispatcher/filters/index.rst:53
msgid "Own filter example" msgid "Own filter example"
msgstr "Приклад власного фільтра" msgstr "Приклад власного фільтра"
#: ../../dispatcher/filters/index.rst:53 #: ../../dispatcher/filters/index.rst:55
msgid "For example if you need to make simple text filter:" msgid "For example if you need to make simple text filter:"
msgstr "Наприклад, якщо Вам потрібно створити простий текстовий фільтр:" msgstr "Наприклад, якщо Вам потрібно створити простий текстовий фільтр:"
#: ../../dispatcher/filters/index.rst:60 #: ../../dispatcher/filters/index.rst:62
msgid "Combining Filters" msgid "Combining Filters"
msgstr "Комбінування фільтрів" msgstr "Комбінування фільтрів"
#: ../../dispatcher/filters/index.rst:62 #: ../../dispatcher/filters/index.rst:64
msgid "In general, all filters can be combined in two ways" msgid "In general, all filters can be combined in two ways"
msgstr "Взагалом, усі фільтри можна комбінувати двома способами" msgstr "Взагалом, усі фільтри можна комбінувати двома способами"
#: ../../dispatcher/filters/index.rst:66 #: ../../dispatcher/filters/index.rst:68
msgid "Recommended way" msgid "Recommended way"
msgstr "Рекомендований спосіб" msgstr "Рекомендований спосіб"
#: ../../dispatcher/filters/index.rst:68 #: ../../dispatcher/filters/index.rst:70
msgid "" msgid ""
"If you specify multiple filters in a row, it will be checked with an \"and\" " "If you specify multiple filters in a row, it will be checked with an "
"condition:" "\"and\" condition:"
msgstr "" msgstr ""
"Якщо Ви вкажете кілька фільтрів поспіль, це буде перевірено умовою \"and\" :" "Якщо Ви вкажете кілька фільтрів поспіль, це буде перевірено умовою "
"\"and\" :"
#: ../../dispatcher/filters/index.rst:75 #: ../../dispatcher/filters/index.rst:77
msgid "" msgid ""
"Also, if you want to use two alternative ways to run the same handler (\"or\" " "Also, if you want to use two alternative ways to run the same handler "
"condition) you can register the handler twice or more times as you like" "(\"or\" condition) you can register the handler twice or more times as "
"you like"
msgstr "" msgstr ""
"Крім того, якщо ви хочете використовувати два альтернативні способи запуску " "Крім того, якщо ви хочете використовувати два альтернативні способи "
"одного обробника (умова \"or\"), ви можете зареєструвати обробник двічі або " "запуску одного обробника (умова \"or\"), ви можете зареєструвати обробник"
"більше разів, як вам подобається" " двічі або більше разів, як вам подобається"
#: ../../dispatcher/filters/index.rst:84 #: ../../dispatcher/filters/index.rst:86
msgid "" msgid ""
"Also sometimes you will need to invert the filter result, for example you have " "Also sometimes you will need to invert the filter result, for example you"
"an *IsAdmin* filter and you want to check if the user is not an admin" " have an *IsAdmin* filter and you want to check if the user is not an "
"admin"
msgstr "" msgstr ""
"Також іноді Вам потрібно буде інвертувати результат фільтра, наприклад, у вас є " "Також іноді Вам потрібно буде інвертувати результат фільтра, наприклад, у"
"фільтр *IsAdmin* і ви хочете перевірити, чи користувач не є адміністратором" " вас є фільтр *IsAdmin* і ви хочете перевірити, чи користувач не є "
"адміністратором"
#: ../../dispatcher/filters/index.rst:93 #: ../../dispatcher/filters/index.rst:95
msgid "Another possible way" msgid "Another possible way"
msgstr "Інший можливий спосіб" msgstr "Інший можливий спосіб"
#: ../../dispatcher/filters/index.rst:95 #: ../../dispatcher/filters/index.rst:97
msgid "" msgid ""
"An alternative way is to combine using special functions (:func:`and_f`, :func:" "An alternative way is to combine using special functions (:func:`and_f`, "
"`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):" ":func:`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):"
msgstr "" msgstr ""
"Альтернативним способом є об’єднання за допомогою спеціальних функцій (:func:" "Альтернативним способом є об’єднання за допомогою спеціальних функцій "
"`and_f`, :func:`or_f`, :func:`invert_f` з модуля :code:`aiogram.filters`):" "(:func:`and_f`, :func:`or_f`, :func:`invert_f` з модуля "
":code:`aiogram.filters`):"

View file

@ -3,303 +3,422 @@
# This file is distributed under the same license as the aiogram package. # This file is distributed under the same license as the aiogram package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023. # FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
# #
#, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: aiogram \n" "Project-Id-Version: aiogram\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-26 23:17+0300\n" "POT-Creation-Date: 2023-09-14 18:12+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2023-09-14 18:34+0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: \n"
"Language: uk_UA\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 "
"&& (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Generated-By: Babel 2.12.1\n" "Generated-By: Babel 2.12.1\n"
"X-Generator: Poedit 3.3.2\n"
#: ../../migration_2_to_3.rst:3 #: ../../migration_2_to_3.rst:3
msgid "Migration FAQ (2.x -> 3.0)" msgid "Migration FAQ (2.x -> 3.0)"
msgstr "" msgstr "FAQ по переходу з версії 2.x на 3.0"
#: ../../migration_2_to_3.rst:7 #: ../../migration_2_to_3.rst:7
msgid "This guide is still in progress." msgid "This guide is still in progress."
msgstr "" msgstr "Цей посібник все ще в розробці."
#: ../../migration_2_to_3.rst:9 #: ../../migration_2_to_3.rst:9
msgid "" msgid ""
"This version introduces much many breaking changes and architectural " "This version introduces numerous breaking changes and architectural "
"improvements, helping to reduce global variables count in your code, " "improvements. It helps reduce the count of global variables in your code, "
"provides useful mechanisms to separate your code to modules or just make " "provides useful mechanisms to modularize your code, and enables the creation of "
"sharable modules via packages on the PyPi, makes middlewares and filters " "shareable modules via packages on PyPI. It also makes middlewares and filters "
"more controllable and others." "more controllable, among other improvements."
msgstr "" msgstr ""
"Ця версія містить численні суттєві зміни та архітектурні покращення. Вона "
"допомагає зменшити кількість глобальних змінних у вашому коді, надає корисні "
"механізми для модуляризації вашого коду та дозволяє створювати спільні модулі "
"за допомогою пакетів на PyPI. Крім того, серед інших покращень, він робить "
"проміжне програмне забезпечення (мідлварі) та фільтри більш контрольованими."
#: ../../migration_2_to_3.rst:14 #: ../../migration_2_to_3.rst:15
msgid "" msgid ""
"On this page you can read about points that changed corresponding to last" "On this page, you can read about the changes made in relation to the last "
" stable 2.x version." "stable 2.x version."
msgstr "" msgstr ""
"На цій сторінці ви можете прочитати про зміни, внесені в останню стабільну "
"версію 2.x."
#: ../../migration_2_to_3.rst:18 #: ../../migration_2_to_3.rst:19
msgid "" msgid ""
"This page is most like a detailed changelog than a migration guide, but " "This page more closely resembles a detailed changelog than a migration guide, "
"it will be updated in the future." "but it will be updated in the future."
msgstr "" msgstr ""
"Ця сторінка більше нагадує детальний список змін, ніж посібник з міграції, але "
"вона буде оновлюватися в майбутньому."
#: ../../migration_2_to_3.rst:21 #: ../../migration_2_to_3.rst:22
msgid "" msgid ""
"Feel free to contribute to this page, if you find something that is not " "Feel free to contribute to this page, if you find something that is not "
"mentioned here." "mentioned here."
msgstr "" msgstr ""
"Не соромтеся зробити свій внесок у цю сторінку, якщо ви знайшли щось, про що "
"тут не згадано."
#: ../../migration_2_to_3.rst:25 #: ../../migration_2_to_3.rst:26
msgid "Dispatcher" msgid "Dispatcher"
msgstr "" msgstr ""
#: ../../migration_2_to_3.rst:27 #: ../../migration_2_to_3.rst:28
msgid "" msgid ""
":class:`Dispatcher` class no longer accepts the `Bot` instance into the " "The :class:`Dispatcher` class no longer accepts a `Bot` instance in its "
"initializer, it should be passed to dispatcher only for starting polling " "initializer. Instead, the `Bot` instance should be passed to the dispatcher "
"or handling event from webhook. Also this way adds possibility to use " "only for starting polling or handling events from webhooks. This approach also "
"multiple bot instances at the same time (\"multibot\")" "allows for the use of multiple bot instances simultaneously (\"multibot\")."
msgstr "" msgstr ""
"Клас :class:`Dispatcher` більше не приймає екземпляр `Bot` у своєму "
"ініціалізаторі. Замість цього екземпляр `Bot` слід передавати диспетчеру тільки "
"для запуску полінгу або обробки подій з вебхуків. Такий підхід також дозволяє "
"використовувати декілька екземплярів бота одночасно (\"мультибот\")."
#: ../../migration_2_to_3.rst:30 #: ../../migration_2_to_3.rst:32
msgid "" msgid ""
":class:`Dispatcher` now can be extended with another Dispatcher-like " ":class:`Dispatcher` now can be extended with another Dispatcher-like thing "
"thing named :class:`Router` (:ref:`Read more » <Nested routers>`). With " "named :class:`Router` (:ref:`Read more » <Nested routers>`)."
"routes you can easily separate your code to multiple modules and may be "
"share this modules between projects."
msgstr "" msgstr ""
"Клас :class:`Dispatcher` тепер можна розширити ще одним об'єктом на кшталт "
"диспетчера з назвою :class:`Router` (:ref:`Детальніше » <Nested routers>`)."
#: ../../migration_2_to_3.rst:34 #: ../../migration_2_to_3.rst:34
msgid "" msgid ""
"With routes, you can easily modularize your code and potentially share these "
"modules between projects."
msgstr ""
"За допомогою роутерів ви можете легко модулювати свій код і потенційно "
"перевикористовувати ці модулі між проектами."
#: ../../migration_2_to_3.rst:35
msgid ""
"Removed the **_handler** suffix from all event handler decorators and " "Removed the **_handler** suffix from all event handler decorators and "
"registering methods. (:ref:`Read more » <Event observers>`)" "registering methods. (:ref:`Read more » <Event observers>`)"
msgstr "" msgstr ""
"Видалено суфікс **_handler** з усіх декораторів обробників подій та методів "
#: ../../migration_2_to_3.rst:36 "реєстрації. (:ref:`Детальніше » <Event observers>`)"
msgid ""
"Executor entirely removed, now you can use Dispatcher directly to start "
"polling or webhook."
msgstr ""
#: ../../migration_2_to_3.rst:37 #: ../../migration_2_to_3.rst:37
msgid "" msgid ""
"Throttling method is completely removed, now you can use middlewares to " "The Executor has been entirely removed; you can now use the Dispatcher directly "
"control the execution context and use any throttling mechanism you want." "to start polling or handle webhooks."
msgstr "" msgstr ""
"Executor було повністю вилучено; тепер ви можете використовувати Dispatcher "
"безпосередньо для запуску полінгу або обробки вебхуків."
#: ../../migration_2_to_3.rst:39 #: ../../migration_2_to_3.rst:38
msgid "" msgid ""
"Removed global context variables from the API types, Bot and Dispatcher " "The throttling method has been completely removed; you can now use middlewares "
"object, from now if you want to get current bot instance inside handlers " "to control the execution context and implement any throttling mechanism you "
"or filters you should accept the argument :code:`bot: Bot` and use it " "desire."
"instead of :code:`Bot.get_current()` Inside middlewares it can be "
"accessed via :code:`data[\"bot\"]`."
msgstr "" msgstr ""
"Метод дроселювання (Throttling) повністю вилучено; тепер ви можете "
"використовувати проміжне програмне забезпечення (middleware) для керування "
"контекстом виконання та реалізовувати будь-який механізм дроселювання за вашим "
"бажанням."
#: ../../migration_2_to_3.rst:43 #: ../../migration_2_to_3.rst:40
msgid "" msgid ""
"Now to skip pending updates, you should call the " "Removed global context variables from the API types, Bot and Dispatcher object, "
":class:`aiogram.methods.delete_webhook.DeleteWebhook` method directly " "From now on, if you want to access the current bot instance within handlers or "
"instead of passing :code:`skip_updates=True` to start polling method." "filters, you should accept the argument :code:`bot: Bot` and use it instead of :"
"code:`Bot.get_current()`. In middlewares, it can be accessed via :code:"
"`data[\"bot\"]`."
msgstr "" msgstr ""
"Вилучено глобальні контекстні змінні з типів API, об'єктів Bot та Dispatcher, "
"Відтепер, якщо ви хочете отримати доступ до поточного екземпляру бота в "
"обробниках або фільтрах, ви повинні приймати аргумент :code:`bot: Bot` і "
"використовувати його замість :code:`Bot.get_current()`. У проміжному "
"програмному забезпеченні (middleware) доступ до нього можна отримати через :"
"code:`data[\"bot\"]`."
#: ../../migration_2_to_3.rst:47 #: ../../migration_2_to_3.rst:44
msgid "Filtering events" msgid ""
"To skip pending updates, you should now call the :class:`aiogram.methods."
"delete_webhook.DeleteWebhook` method directly, rather than passing :code:"
"`skip_updates=True` to the start polling method."
msgstr "" msgstr ""
"Щоб пропустити очікувані оновлення, тепер вам слід викликати метод :class:"
"`aiogram.methods.delete_webhook.DeleteWebhook` безпосередньо, а не передавати :"
"code:`skip_updates=True` до методу запуску полінгу."
#: ../../migration_2_to_3.rst:49 #: ../../migration_2_to_3.rst:49
msgid "" msgid "Filtering events"
"Keyword filters can no more be used, use filters explicitly. (`Read more " msgstr "Фільтрація подій"
"» <https://github.com/aiogram/aiogram/issues/942>`_)"
msgstr ""
#: ../../migration_2_to_3.rst:50 #: ../../migration_2_to_3.rst:51
msgid "" msgid ""
"In due to keyword filters was removed all enabled by default filters " "Keyword filters can no longer be used; use filters explicitly. (`Read more » "
"(state and content_type now is not enabled), so you should specify them " "<https://github.com/aiogram/aiogram/issues/942>`_)"
"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 "" msgstr ""
"Фільтри за ключовими словами більше не можна використовувати; використовуйте "
"фільтри явно. (`Детальніше » <https://github.com/aiogram/aiogram/issues/942>`_)"
#: ../../migration_2_to_3.rst:54 #: ../../migration_2_to_3.rst:52
msgid "" msgid ""
"Most of common filters is replaced by \"magic filter\". (:ref:`Read more " "Due to the removal of keyword filters, all previously enabled-by-default "
"» <magic-filters>`)" "filters (such as state and content_type) are now disabled. You must specify "
msgstr "" "them explicitly if you wish to use them. For example instead of using :code:"
"`@dp.message_handler(content_types=ContentType.PHOTO)` you should use :code:"
#: ../../migration_2_to_3.rst:55 "`@router.message(F.photo)`"
msgid ""
"Now by default message handler receives any content type, if you want "
"specific one just add the filters (Magic or any other)"
msgstr "" msgstr ""
"У зв'язку з вилученням keyword фільтрів, всі раніше ввімкнені за замовчуванням "
"фільтри (такі як state і content_type) тепер вимкнено. Якщо ви бажаєте їх "
"використовувати, ви повинні вказати їх явно. Наприклад, замість :code:`@dp."
"message_handler(content_types=ContentType.PHOTO)` слід використовувати :code:"
"`@router.message(F.photo)`."
#: ../../migration_2_to_3.rst:57 #: ../../migration_2_to_3.rst:57
msgid "" msgid ""
"State filter now is not enabled by default, that's mean if you using " "Most common filters have been replaced by the \"magic filter.\" (:ref:`Read "
":code:`state=\"*\"` in v2 then you should not pass any state filter in " "more » <magic-filters>`)"
"v3, and vice versa, if the state in v2 is not specified now you should "
"specify the state."
msgstr "" msgstr ""
"Більшість звичайних фільтрів було замінено на \"магічний фільтр\". (:ref:`Детальніше "
"далі » <magic-filters>`)"
#: ../../migration_2_to_3.rst:58
msgid ""
"By default, the message handler now receives any content type. If you want a "
"specific one, simply add the appropriate filters (Magic or any other)."
msgstr ""
"За замовчуванням обробник повідомлень тепер отримує будь-який тип вмісту. Якщо "
"вам потрібен певний тип, просто додайте відповідні фільтри (Magic або будь-який "
"інший)."
#: ../../migration_2_to_3.rst:60 #: ../../migration_2_to_3.rst:60
msgid "" msgid ""
"Added possibility to register per-router global filters, that helps to " "The state filter is no longer enabled by default. This means that if you used :"
"reduces the number of repetitions in the code and makes easily way to " "code:`state=\"*\"` in v2, you should not pass any state filter in v3. "
"control for what each router will be used." "Conversely, if the state was not specified in v2, you will now need to specify "
"it in v3."
msgstr "" msgstr ""
"Фільтр стану більше не вмикається за замовчуванням. Це означає, що якщо ви "
"використовували :code:`state=\"*\"` у v2, вам не слід передавати фільтр стану у "
"v3. І навпаки, якщо стан не було вказано у v2, вам потрібно буде вказати його у "
"v3."
#: ../../migration_2_to_3.rst:66 #: ../../migration_2_to_3.rst:63
msgid ""
"Added the possibility to register global filters for each router, which helps "
"to reduce code repetition and provides an easier way to control the purpose of "
"each router."
msgstr ""
"Додано можливість реєстрації глобальних фільтрів для кожного роутера, що "
"допомагає зменшити повторення коду і полегшує контроль призначення кожного "
"роутера."
#: ../../migration_2_to_3.rst:69
msgid "Bot API" msgid "Bot API"
msgstr "" msgstr ""
#: ../../migration_2_to_3.rst:68 #: ../../migration_2_to_3.rst:71
msgid "" msgid ""
"Now all API methods is classes with validation (via `pydantic " "All API methods are now classes with validation, implemented via `pydantic "
"<https://docs.pydantic.dev/>`_) (all API calls is also available as " "<https://docs.pydantic.dev/>`. These API calls are also available as methods in "
"methods in the Bot class)." "the Bot class."
msgstr "" msgstr ""
"Всі методи API тепер є класами з валідацією, реалізованими через `pydantic "
"<https://docs.pydantic.dev/>`. Ці виклики API також доступні як методи в класі "
"Bot."
#: ../../migration_2_to_3.rst:70 #: ../../migration_2_to_3.rst:74
msgid "" msgid ""
"Added more pre-defined Enums and moved into `aiogram.enums` sub-package. " "More pre-defined Enums have been added and moved to the `aiogram.enums` sub-"
"For example chat type enum now is :class:`aiogram.enums.ChatType` instead" "package. For example, the chat type enum is now :class:`aiogram.enums.ChatType` "
" of :class:`aiogram.types.chat.ChatType`. (:ref:`Read more » <enums>`)" "instead of :class:`aiogram.types.chat.ChatType`."
msgstr "" msgstr ""
"Додано більше попередньо визначених enums та переміщено їх до підпакету "
"`aiogram.enums`. Наприклад, enum типу чату тепер має вигляд :class:`aiogram."
"enums.ChatType` замість :class:`aiogram.types.chat.ChatType`."
#: ../../migration_2_to_3.rst:73 #: ../../migration_2_to_3.rst:76
msgid "" msgid ""
"Separated HTTP client session into container that can be reused between " "The HTTP client session has been separated into a container that can be reused "
"different Bot instances in the application." "across different Bot instances within the application."
msgstr "" msgstr ""
"Клієнтська сесія HTTP була відокремлена в контейнер, який можна повторно "
"використовувати для різних екземплярів бота в додатку."
#: ../../migration_2_to_3.rst:75 #: ../../migration_2_to_3.rst:78
msgid "" msgid ""
"API Exceptions is no more classified by specific message in due to " "API Exceptions are no longer classified by specific messages, as Telegram has "
"Telegram has no documented error codes. But all errors is classified by " "no documented error codes. However, all errors are classified by HTTP status "
"HTTP status code and for each method only one case can be caused with the" "codes, and for each method, only one type of error can be associated with a "
" same code, so in most cases you should check that only error type (by " "given code. Therefore, in most cases, you should check only the error type (by "
"status-code) without checking error message. (:ref:`Read more » <error-" "status code) without inspecting the error message."
"types>`)"
msgstr ""
#: ../../migration_2_to_3.rst:82
msgid "Middlewares"
msgstr ""
#: ../../migration_2_to_3.rst:84
msgid ""
"Middlewares can now control a execution context, e.g. using context "
"managers (:ref:`Read more » <middlewares>`)"
msgstr ""
#: ../../migration_2_to_3.rst:85
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 "" msgstr ""
"Виключення API більше не класифікуються за конкретними повідомленнями, оскільки "
"Telegram не має задокументованих кодів помилок. Проте всі помилки "
"класифікуються за кодами статусу HTTP, і для кожного методу з певним кодом може "
"бути пов'язаний лише один тип помилки. Тому в більшості випадків слід "
"перевіряти лише тип помилки (за кодом статусу), не перевіряючи повідомлення про "
"помилку."
#: ../../migration_2_to_3.rst:88 #: ../../migration_2_to_3.rst:88
msgid "" msgid "Middlewares"
"Added mechanism named **flags**, that helps to customize handler behavior" msgstr "Проміжне ПО (Middlewares)"
" in conjunction with middlewares. (:ref:`Read more » <flags>`)"
msgstr ""
#: ../../migration_2_to_3.rst:93 #: ../../migration_2_to_3.rst:90
msgid "Keyboard Markup" msgid ""
"Middlewares can now control an execution context, e.g., using context managers. "
"(:ref:`Read more » <middlewares>`)"
msgstr "" msgstr ""
"Проміжне програмне забезпечення тепер може керувати контекстом виконання, "
"наприклад, за допомогою менеджерів контексту. (:ref:`Детальніше » "
"<middlewares>`)"
#: ../../migration_2_to_3.rst:92
msgid ""
"All contextual data is now shared end-to-end between middlewares, filters, and "
"handlers. 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:95 #: ../../migration_2_to_3.rst:95
msgid "" msgid ""
"Now :class:`aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup` " "Added a mechanism named **flags** that helps customize handler behavior in "
"and :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup` has " "conjunction with middlewares. (:ref:`Read more » <flags>`)"
"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 » <Keyboard builder>`)"
msgstr "" msgstr ""
"Додано механізм з назвою **flags**, який допомагає налаштовувати поведінку "
"обробника у поєднанні з проміжним програмним забезпеченням. (:ref:`Детальніше "
"про » <flags>`)"
#: ../../migration_2_to_3.rst:103 #: ../../migration_2_to_3.rst:100
msgid "Callbacks data" msgid "Keyboard Markup"
msgstr "" msgstr "Розмітка клавіатури"
#: ../../migration_2_to_3.rst:105 #: ../../migration_2_to_3.rst:102
msgid "" msgid ""
"Callback data factory now is strictly typed via `pydantic " "Now :class:`aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup` and :"
"<https://docs.pydantic.dev/>`_ models (:ref:`Read more » <Callback data " "class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup` no longer have "
"factory>`)" "methods for extension, instead you have to use markup builders :class:`aiogram."
"utils.keyboard.ReplyKeyboardBuilder` and :class:`aiogram.utils.keyboard."
"KeyboardBuilder` respectively (:ref:`Read more » <Keyboard builder>`)"
msgstr "" msgstr ""
"Тепер :class:`aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup` та :"
"class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup` більше не мають "
"методів для розширення, натомість вам слід використовувати будівники розмітки :"
"class:`aiogram.utils.keyboard.ReplyKeyboardBuilder` та :class:`aiogram.utils.keyboard.InlineKeyboardBuilder` "
"відповідно (:ref:`Детальніше » <Keyboard builder>`)"
#: ../../migration_2_to_3.rst:110 #: ../../migration_2_to_3.rst:110
msgid "Finite State machine" msgid "Callbacks data"
msgstr "" msgstr ""
#: ../../migration_2_to_3.rst:112 #: ../../migration_2_to_3.rst:112
msgid "" msgid ""
"State filter will no more added to all handlers, you will need to specify" "The callback data factory is now strictly typed using `pydantic <https://docs."
" state if you want" "pydantic.dev/>`_ models. (:ref:`Read more » <Callback data factory>`)"
msgstr "" msgstr ""
"Фабрику даних зворотного виклику тепер строго типізовано за допомогою моделей "
"`pydantic <https://docs.pydantic.dev/>`_. (:ref:`Детальніше » <Callback data "
"factory>`)"
#: ../../migration_2_to_3.rst:113 #: ../../migration_2_to_3.rst:117
msgid "Finite State machine"
msgstr "Скінченний автомат"
#: ../../migration_2_to_3.rst:119
msgid "" msgid ""
"Added possibility to change FSM strategy, for example if you want to " "State filters will no longer be automatically added to all handlers; you will "
"control state for each user in chat topics instead of user in chat you " "need to specify the state if you want to use it."
"can specify it in the Dispatcher."
msgstr "" msgstr ""
"Фільтри станів більше не будуть автоматично додаватися до всіх обробників; вам "
"потрібно буде вказати стан, якщо ви хочете його використати."
#: ../../migration_2_to_3.rst:115 #: ../../migration_2_to_3.rst:121
msgid "" msgid ""
"Now :class:`aiogram.fsm.state.State` and " "Added the possibility to change the FSM strategy. For example, if you want to "
":class:`aiogram.fsm.state.StateGroup` don't have helper methods like " "control the state for each user based on chat topics rather than the user in a "
":code:`.set()`, :code:`.next()`, etc." "chat, you can specify this in the Dispatcher."
msgstr "" msgstr ""
"Додано можливість змінювати стратегію FSM. Наприклад, якщо ви хочете "
"контролювати стан для кожного користувача на основі топіків чату, а не "
"користувача в чаті, ви можете вказати це в Диспетчері."
#: ../../migration_2_to_3.rst:118 #: ../../migration_2_to_3.rst:124
msgid "" msgid ""
"Instead of this you should set states by passing them directly to " "Now :class:`aiogram.fsm.state.State` and :class:`aiogram.fsm.state.StateGroup` "
":class:`aiogram.fsm.context.FSMContext` (:ref:`Read more » <Finite State " "don't have helper methods like :code:`.set()`, :code:`.next()`, etc."
"Machine>`)"
msgstr ""
#: ../../migration_2_to_3.rst:120
msgid ""
"State proxy is deprecated, you should update the state data by calling "
":code:`state.set_data(...)` and :code:`state.get_data()` respectively."
msgstr ""
#: ../../migration_2_to_3.rst:125
msgid "Sending Files"
msgstr "" msgstr ""
"Тепер :class:`aiogram.fsm.state.State` та :class:`aiogram.fsm.state.StateGroup` "
"не мають допоміжних методів, таких як :code:`.set()`, :code:`.next()` тощо."
#: ../../migration_2_to_3.rst:127 #: ../../migration_2_to_3.rst:127
msgid "" msgid ""
"From now you should wrap sending files into InputFile object before send " "Instead, you should set states by passing them directly to :class:`aiogram.fsm."
"instead of passing IO object directly to the API method. (:ref:`Read more" "context.FSMContext` (:ref:`Read more » <Finite State Machine>`)"
" » <sending-files>`)"
msgstr "" msgstr ""
"Замість цього вам слід встановлювати стани, передаючи їх безпосередньо до :"
"class:`aiogram.fsm.context.FSMContext` (:ref:`Детальніше » <Finite State "
"Machine>`)"
#: ../../migration_2_to_3.rst:132 #: ../../migration_2_to_3.rst:129
msgid ""
"The state proxy is deprecated; you should update the state data by calling :"
"code:`state.set_data(...)` and :code:`state.get_data()` respectively."
msgstr ""
"Проксі стану є застарілим; вам слід оновити дані стану, викликавши :code:`state."
"set_data(...)` та :code:`state.get_data()` відповідно."
#: ../../migration_2_to_3.rst:134
msgid "Sending Files"
msgstr "Надсилання файлів"
#: ../../migration_2_to_3.rst:136
msgid ""
"From now on, you should wrap files in an InputFile object before sending them, "
"instead of passing the IO object directly to the API method. (:ref:`Read more » "
"<sending-files>`)"
msgstr ""
"Відтепер перед відправкою файлів слід обертати їх в об'єкт InputFile замість "
"того, щоб передавати об'єкт вводу-виводу безпосередньо до методу API. (:ref:"
"`Детальніше » <sending-files>`)"
#: ../../migration_2_to_3.rst:141
msgid "Webhook" msgid "Webhook"
msgstr "" msgstr ""
#: ../../migration_2_to_3.rst:134 #: ../../migration_2_to_3.rst:143
msgid "Simplified aiohttp web app configuration" msgid "The aiohttp web app configuration has been simplified."
msgstr "" msgstr "Спрощено налаштування веб-застосунку aiohttp."
#: ../../migration_2_to_3.rst:135 #: ../../migration_2_to_3.rst:144
msgid "" msgid ""
"By default added possibility to upload files when you use reply into " "By default, the ability to upload files has been added when you use the reply "
"webhook" "function in a webhook."
msgstr "" msgstr ""
"За замовчуванням додана можливість завантажувати файли, коли ви використовуєте "
"функцію відповіді у вебхук."
#~ msgid "" #: ../../migration_2_to_3.rst:148
#~ "Callback data factory now is strictly" msgid "Telegram API Server"
#~ " typed via `pydantic " msgstr "Сервер Telegram API"
#~ "<https://docs.pydantic.dev/>`_ models (:ref:`Read "
#~ "more » <callback-data-factory>`)" #: ../../migration_2_to_3.rst:150
#~ msgstr "" msgid ""
"The `server` parameter has been moved from the `Bot` instance to `api` in "
"`BaseSession`."
msgstr ""
"Параметр `server` було перенесено з екземпляра `Bot` до `api` в `BaseSession`."
#: ../../migration_2_to_3.rst:151
msgid ""
"The constant `aiogram.bot.api.TELEGRAM_PRODUCTION` has been moved to `aiogram."
"client.telegram.PRODUCTION`."
msgstr ""
"Константа `aiogram.bot.api.TELEGRAM_PRODUCTION` була переміщена на `aiogram."
"client.telegram.PRODUCTION`."

View file

@ -0,0 +1,291 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, aiogram Team
# This file is distributed under the same license as the aiogram package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: aiogram \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-14 17:21+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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"
#: ../../utils/media_group.rst:3
msgid "Media group builder"
msgstr ""
#: ../../utils/media_group.rst:5
msgid ""
"This module provides a builder for media groups, it can be used to build "
"media groups for "
":class:`aiogram.types.input_media_photo.InputMediaPhoto`, "
":class:`aiogram.types.input_media_video.InputMediaVideo`, "
":class:`aiogram.types.input_media_document.InputMediaDocument` and "
":class:`aiogram.types.input_media_audio.InputMediaAudio`."
msgstr ""
#: ../../utils/media_group.rst:11
msgid ""
":class:`aiogram.types.input_media_animation.InputMediaAnimation` is not "
"supported yet in the Bot API to send as media group."
msgstr ""
#: ../../utils/media_group.rst:16
msgid "Usage"
msgstr ""
#: ../../utils/media_group.rst:30
msgid ""
"To send media group use "
":meth:`aiogram.methods.send_media_group.SendMediaGroup` method, but when "
"you use :class:`aiogram.utils.media_group.MediaGroupBuilder` you should "
"pass ``media`` argument as ``media_group.build()``."
msgstr ""
#: ../../utils/media_group.rst:34
msgid ""
"If you specify ``caption`` in "
":class:`aiogram.utils.media_group.MediaGroupBuilder` it will be used as "
"``caption`` for first media in group."
msgstr ""
#: ../../utils/media_group.rst:43
msgid "References"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add:1 of
msgid "Add a media object to the media group."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio
#: aiogram.utils.media_group.MediaGroupBuilder.add_document
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo
#: aiogram.utils.media_group.MediaGroupBuilder.add_video of
msgid "Parameters"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add:3 of
msgid ""
"Keyword arguments for the media object. The available keyword arguments "
"depend on the media type."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio
#: aiogram.utils.media_group.MediaGroupBuilder.add_document
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo
#: aiogram.utils.media_group.MediaGroupBuilder.add_video
#: aiogram.utils.media_group.MediaGroupBuilder.build of
msgid "Returns"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add:5
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:22
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:27
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:17
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:30 of
msgid "None"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:1 of
msgid "Add an audio file to the media group."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:3
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:3 of
msgid ""
"File to send. Pass a file_id to send a file that exists on the Telegram "
"servers (recommended), pass an HTTP URL for Telegram to get a file from "
"the Internet, or pass 'attach://<file_attach_name>' to upload a new one "
"using multipart/form-data under <file_attach_name> name. :ref:`More "
"information on Sending Files » <sending-files>`"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:3
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:3 of
msgid ""
"File to send. Pass a file_id to send a file that exists on the Telegram "
"servers (recommended), pass an HTTP URL for Telegram to get a file from "
"the Internet, or pass 'attach://<file_attach_name>' to upload a new one "
"using multipart/form-data under <file_attach_name> name."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:7
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:7 of
msgid ":ref:`More information on Sending Files » <sending-files>`"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:8 of
msgid ""
"*Optional*. Thumbnail of the file sent; can be ignored if thumbnail "
"generation for the file is supported server-side. The thumbnail should be"
" in JPEG format and less than 200 kB in size. A thumbnail's width and "
"height should not exceed 320."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:12 of
msgid ""
"*Optional*. Caption of the audio to be sent, 0-1024 characters after "
"entities parsing"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:14 of
msgid ""
"*Optional*. Mode for parsing entities in the audio caption. See "
"`formatting options <https://core.telegram.org/bots/api#formatting-"
"options>`_ for more details."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:17
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:22
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:13
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:21 of
msgid ""
"*Optional*. List of special entities that appear in the caption, which "
"can be specified instead of *parse_mode*"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:19 of
msgid "*Optional*. Duration of the audio in seconds"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:20 of
msgid "*Optional*. Performer of the audio"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_audio:21 of
msgid "*Optional*. Title of the audio"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:1 of
msgid "Add a document to the media group."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:3
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:3 of
msgid ""
"File to send. Pass a file_id to send a file that exists on the Telegram "
"servers (recommended), pass an HTTP URL for Telegram to get a file from "
"the Internet, or pass 'attach://<file_attach_name>' to upload a new one "
"using multipart/form-data under <file_attach_name> name. :ref:`More "
"information on Sending Files » <sending-files>`"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:8
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:8 of
msgid ""
"*Optional*. Thumbnail of the file sent; can be ignored if thumbnail "
"generation for the file is supported server-side. The thumbnail should be"
" in JPEG format and less than 200 kB in size. A thumbnail's width and "
"height should not exceed 320. Ignored if the file is not uploaded using "
"multipart/form-data. Thumbnails can't be reused and can be only uploaded "
"as a new file, so you can pass 'attach://<file_attach_name>' if the "
"thumbnail was uploaded using multipart/form-data under "
"<file_attach_name>. :ref:`More information on Sending Files » <sending-"
"files>`"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:17 of
msgid ""
"*Optional*. Caption of the document to be sent, 0-1024 characters after "
"entities parsing"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:19 of
msgid ""
"*Optional*. Mode for parsing entities in the document caption. See "
"`formatting options <https://core.telegram.org/bots/api#formatting-"
"options>`_ for more details."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_document:24 of
msgid ""
"*Optional*. Disables automatic server-side content type detection for "
"files uploaded using multipart/form-data. Always :code:`True`, if the "
"document is sent as part of an album."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:1 of
msgid "Add a photo to the media group."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:8 of
msgid ""
"*Optional*. Caption of the photo to be sent, 0-1024 characters after "
"entities parsing"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:10 of
msgid ""
"*Optional*. Mode for parsing entities in the photo caption. See "
"`formatting options <https://core.telegram.org/bots/api#formatting-"
"options>`_ for more details."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_photo:15 of
msgid ""
"*Optional*. Pass :code:`True` if the photo needs to be covered with a "
"spoiler animation"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:1 of
msgid "Add a video to the media group."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:16 of
msgid ""
"*Optional*. Caption of the video to be sent, 0-1024 characters after "
"entities parsing"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:18 of
msgid ""
"*Optional*. Mode for parsing entities in the video caption. See "
"`formatting options <https://core.telegram.org/bots/api#formatting-"
"options>`_ for more details."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:23 of
msgid "*Optional*. Video width"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:24 of
msgid "*Optional*. Video height"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:25 of
msgid "*Optional*. Video duration in seconds"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:26 of
msgid ""
"*Optional*. Pass :code:`True` if the uploaded video is suitable for "
"streaming"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.add_video:28 of
msgid ""
"*Optional*. Pass :code:`True` if the video needs to be covered with a "
"spoiler animation"
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.build:1 of
msgid "Builds a list of media objects for a media group."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.build:3 of
msgid "Adds the caption to the first media object if it is present."
msgstr ""
#: aiogram.utils.media_group.MediaGroupBuilder.build:5 of
msgid "List of media objects."
msgstr ""

View file

@ -6,16 +6,17 @@ Migration FAQ (2.x -> 3.0)
This guide is still in progress. This guide is still in progress.
This version introduces much many breaking changes and architectural improvements, This version introduces numerous breaking changes and architectural improvements.
helping to reduce global variables count in your code, provides useful mechanisms It helps reduce the count of global variables in your code, provides useful mechanisms
to separate your code to modules or just make sharable modules via packages on the PyPi, to modularize your code, and enables the creation of shareable modules via packages on PyPI.
makes middlewares and filters more controllable and others. It also makes middlewares and filters more controllable, among other improvements.
On this page you can read about points that changed corresponding to last stable 2.x version.
On this page, you can read about the changes made in relation to the last stable 2.x version.
.. note:: .. note::
This page is most like a detailed changelog than a migration guide, This page more closely resembles a detailed changelog than a migration guide,
but it will be updated in the future. but it will be updated in the future.
Feel free to contribute to this page, if you find something that is not mentioned here. Feel free to contribute to this page, if you find something that is not mentioned here.
@ -24,68 +25,74 @@ On this page you can read about points that changed corresponding to last stable
Dispatcher Dispatcher
========== ==========
- :class:`Dispatcher` class no longer accepts the `Bot` instance into the initializer, - The :class:`Dispatcher` class no longer accepts a `Bot` instance in its initializer.
it should be passed to dispatcher only for starting polling or handling event from webhook. Instead, the `Bot` instance should be passed to the dispatcher only for starting polling
Also this way adds possibility to use multiple bot instances at the same time ("multibot") or handling events from webhooks. This approach also allows for the use of multiple bot
instances simultaneously ("multibot").
- :class:`Dispatcher` now can be extended with another Dispatcher-like - :class:`Dispatcher` now can be extended with another Dispatcher-like
thing named :class:`Router` (:ref:`Read more » <Nested routers>`). thing named :class:`Router` (:ref:`Read more » <Nested routers>`).
With routes you can easily separate your code to multiple modules - With routes, you can easily modularize your code and potentially share these modules between projects.
and may be share this modules between projects.
- Removed the **_handler** suffix from all event handler decorators and registering methods. - Removed the **_handler** suffix from all event handler decorators and registering methods.
(:ref:`Read more » <Event observers>`) (:ref:`Read more » <Event observers>`)
- Executor entirely removed, now you can use Dispatcher directly to start polling or webhook. - The Executor has been entirely removed; you can now use the Dispatcher directly to start poll the API or handle webhooks from it.
- Throttling method is completely removed, now you can use middlewares to control - The throttling method has been completely removed; you can now use middlewares to control
the execution context and use any throttling mechanism you want. the execution context and implement any throttling mechanism you desire.
- Removed global context variables from the API types, Bot and Dispatcher object, - 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 From now on, if you want to access the current bot instance within handlers or filters,
accept the argument :code:`bot: Bot` and use it instead of :code:`Bot.get_current()` 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"]`. In middlewares, it can be accessed via :code:`data["bot"]`.
- Now to skip pending updates, you should call the :class:`aiogram.methods.delete_webhook.DeleteWebhook` method directly instead of passing :code:`skip_updates=True` to start polling method. - To skip pending updates, you should now call the :class:`aiogram.methods.delete_webhook.DeleteWebhook` method directly, rather than passing :code:`skip_updates=True` to the start polling method.
Filtering events Filtering events
================ ================
- Keyword filters can no more be used, use filters explicitly. (`Read more » <https://github.com/aiogram/aiogram/issues/942>`_) - Keyword filters can no longer be used; use filters explicitly. (`Read more » <https://github.com/aiogram/aiogram/issues/942>`_)
- In due to keyword filters was removed all enabled by default filters (state and content_type now is not enabled), - Due to the removal of keyword filters, all previously enabled-by-default filters
so you should specify them explicitly if you want to use. (such as state and content_type) are now disabled.
You must specify them explicitly if you wish to use them.
For example instead of using :code:`@dp.message_handler(content_types=ContentType.PHOTO)` For example instead of using :code:`@dp.message_handler(content_types=ContentType.PHOTO)`
you should use :code:`@router.message(F.photo)` you should use :code:`@router.message(F.photo)`
- Most of common filters is replaced by "magic filter". (:ref:`Read more » <magic-filters>`) - Most common filters have been replaced with the "magic filter." (:ref:`Read more » <magic-filters>`)
- Now by default message handler receives any content type, - By default, the message handler now receives any content type.
if you want specific one just add the filters (Magic or any other) If you want a specific one, simply add the appropriate filters (Magic or any other).
- State filter now is not enabled by default, that's mean if you using :code:`state="*"` in v2 - The state filter is no longer enabled by default. This means that if you used :code:`state="*"`
then you should not pass any state filter in v3, and vice versa, in v2, you should not pass any state filter in v3.
if the state in v2 is not specified now you should specify the state. Conversely, if the state was not specified in v2, you will now need to specify it in v3.
- Added possibility to register per-router global filters, that helps to reduces - Added the possibility to register global filters for each router, which helps to reduce code
the number of repetitions in the code and makes easily way to control repetition and provides an easier way to control the purpose of each router.
for what each router will be used.
Bot API Bot API
======= =======
- Now all API methods is classes with validation (via `pydantic <https://docs.pydantic.dev/>`_) - All API methods are now classes with validation, implemented via
(all API calls is also available as methods in the Bot class). `pydantic <https://docs.pydantic.dev/>`.
- Added more pre-defined Enums and moved into `aiogram.enums` sub-package. For example chat type enum now is These API calls are also available as methods in the Bot class.
:class:`aiogram.enums.ChatType` instead of :class:`aiogram.types.chat.ChatType`. - More pre-defined Enums have been added and moved to the `aiogram.enums` sub-package.
(:ref:`Read more » <enums>`) For example, the chat type enum is now :class:`aiogram.enums.ChatType` instead of :class:`aiogram.types.chat.ChatType`.
- Separated HTTP client session into container that can be reused between different - The HTTP client session has been separated into a container that can be reused
Bot instances in the application. across different Bot instances within the application.
- API Exceptions is no more classified by specific message in due to Telegram has no documented error codes. - API Exceptions are no longer classified by specific messages,
But all errors is classified by HTTP status code and for each method only one case can be caused with the same code, as Telegram has no documented error codes.
so in most cases you should check that only error type (by status-code) without checking error message. However, all errors are classified by HTTP status codes, and for each method,
(:ref:`Read more » <error-types>`) only one type of error can be associated with a given code.
Therefore, in most cases, you should check only the error type (by status code)
without inspecting the error message.
Middlewares Middlewares
=========== ===========
- Middlewares can now control a execution context, e.g. using context managers (:ref:`Read more » <middlewares>`) - Middlewares can now control an execution context, e.g., using context managers.
- All contextual data now is shared between middlewares, filters and handlers to end-to-end use. (:ref:`Read more » <middlewares>`)
- All contextual data is now shared end-to-end between middlewares, filters, and handlers.
For example now you can easily pass some data into context inside middleware and 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. get it in the filters layer as the same way as in the handlers via keyword arguments.
- Added mechanism named **flags**, that helps to customize handler behavior - Added a mechanism named **flags** that helps customize handler behavior
in conjunction with middlewares. (:ref:`Read more » <flags>`) in conjunction with middlewares. (:ref:`Read more » <flags>`)
@ -93,7 +100,7 @@ Keyboard Markup
=============== ===============
- Now :class:`aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup` - Now :class:`aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup`
and :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup` has no methods to extend it, and :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup` no longer have methods for extension,
instead you have to use markup builders :class:`aiogram.utils.keyboard.ReplyKeyboardBuilder` instead you have to use markup builders :class:`aiogram.utils.keyboard.ReplyKeyboardBuilder`
and :class:`aiogram.utils.keyboard.KeyboardBuilder` respectively and :class:`aiogram.utils.keyboard.KeyboardBuilder` respectively
(:ref:`Read more » <Keyboard builder>`) (:ref:`Read more » <Keyboard builder>`)
@ -102,41 +109,43 @@ Keyboard Markup
Callbacks data Callbacks data
============== ==============
- Callback data factory now is strictly typed via `pydantic <https://docs.pydantic.dev/>`_ models - The callback data factory is now strictly typed using `pydantic <https://docs.pydantic.dev/>`_ models.
(:ref:`Read more » <Callback data factory>`) (:ref:`Read more » <Callback data factory>`)
Finite State machine Finite State machine
==================== ====================
- State filter will no more added to all handlers, you will need to specify state if you want - State filters will no longer be automatically added to all handlers;
- Added possibility to change FSM strategy, for example if you want to control state you will need to specify the state if you want to use it.
for each user in chat topics instead of user in chat you can specify it in the Dispatcher. - Added the possibility to change the FSM strategy. For example,
if you want to control the state for each user based on chat topics rather than
the user in a chat, you can specify this in the Dispatcher.
- Now :class:`aiogram.fsm.state.State` and :class:`aiogram.fsm.state.StateGroup` don't have helper - Now :class:`aiogram.fsm.state.State` and :class:`aiogram.fsm.state.StateGroup` don't have helper
methods like :code:`.set()`, :code:`.next()`, etc. methods like :code:`.set()`, :code:`.next()`, etc.
Instead of this you should set states by passing them directly to - Instead, you should set states by passing them directly to
:class:`aiogram.fsm.context.FSMContext` (:ref:`Read more » <Finite State Machine>`) :class:`aiogram.fsm.context.FSMContext` (:ref:`Read more » <Finite State Machine>`)
- State proxy is deprecated, you should update the state data by calling - The state proxy is deprecated; you should update the state data by calling
:code:`state.set_data(...)` and :code:`state.get_data()` respectively. :code:`state.set_data(...)` and :code:`state.get_data()` respectively.
Sending Files Sending Files
============= =============
- From now you should wrap sending files into InputFile object before send instead of passing - From now on, you should wrap files in an InputFile object before sending them,
IO object directly to the API method. (:ref:`Read more » <sending-files>`) instead of passing the IO object directly to the API method. (:ref:`Read more » <sending-files>`)
Webhook Webhook
======= =======
- Simplified aiohttp web app configuration - The aiohttp web app configuration has been simplified.
- By default added possibility to upload files when you use reply into webhook - By default, the ability to upload files has been added when you `make requests in response to updates <https://core.telegram.org/bots/faq#how-can-i-make-requests-in-response-to-updates>`_ (available for webhook only).
Telegram API Server Telegram API Server
=================== ===================
- `server` param was moved from `Bot` instance to `api` in `BaseSession`. - The `server` parameter has been moved from the `Bot` instance to `api` in `BaseSession`.
- `aiogram.bot.api.TELEGRAM_PRODUCTION` was moved to `aiogram.client.telegram.PRODUCTION`. - The constant `aiogram.bot.api.TELEGRAM_PRODUCTION` has been moved to `aiogram.client.telegram.PRODUCTION`.