diff --git a/aiogram/__init__.py b/aiogram/__init__.py index 1d857d70..b3392201 100644 --- a/aiogram/__init__.py +++ b/aiogram/__init__.py @@ -1,6 +1,5 @@ from aiogram.dispatcher.flags import FlagGenerator -from . import filters, handler from .client import session from .client.bot import Bot from .dispatcher.dispatcher import Dispatcher @@ -32,8 +31,6 @@ __all__ = ( "Dispatcher", "Router", "BaseMiddleware", - "filters", - "handler", "F", "html", "md", diff --git a/aiogram/dispatcher/event/handler.py b/aiogram/dispatcher/event/handler.py index 679dc67b..3a507a4e 100644 --- a/aiogram/dispatcher/event/handler.py +++ b/aiogram/dispatcher/event/handler.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, List, Optional, Tuple from magic_filter import MagicFilter from aiogram.dispatcher.flags import extract_flags_from_object -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler CallbackType = Callable[..., Any] diff --git a/aiogram/handler/__init__.py b/aiogram/handlers/__init__.py similarity index 100% rename from aiogram/handler/__init__.py rename to aiogram/handlers/__init__.py diff --git a/aiogram/handler/base.py b/aiogram/handlers/base.py similarity index 100% rename from aiogram/handler/base.py rename to aiogram/handlers/base.py diff --git a/aiogram/handler/callback_query.py b/aiogram/handlers/callback_query.py similarity index 95% rename from aiogram/handler/callback_query.py rename to aiogram/handlers/callback_query.py index 207938d2..31fc9b3d 100644 --- a/aiogram/handler/callback_query.py +++ b/aiogram/handlers/callback_query.py @@ -1,7 +1,7 @@ from abc import ABC from typing import Optional -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import CallbackQuery, Message, User diff --git a/aiogram/handler/chat_member.py b/aiogram/handlers/chat_member.py similarity index 87% rename from aiogram/handler/chat_member.py rename to aiogram/handlers/chat_member.py index d253228d..bf668ac5 100644 --- a/aiogram/handler/chat_member.py +++ b/aiogram/handlers/chat_member.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import ChatMemberUpdated, User diff --git a/aiogram/handler/chosen_inline_result.py b/aiogram/handlers/chosen_inline_result.py similarity index 90% rename from aiogram/handler/chosen_inline_result.py rename to aiogram/handlers/chosen_inline_result.py index f06b34f9..d6b66c54 100644 --- a/aiogram/handler/chosen_inline_result.py +++ b/aiogram/handlers/chosen_inline_result.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import ChosenInlineResult, User diff --git a/aiogram/handler/error.py b/aiogram/handlers/error.py similarity index 86% rename from aiogram/handler/error.py rename to aiogram/handlers/error.py index f31bc368..51ccf079 100644 --- a/aiogram/handler/error.py +++ b/aiogram/handlers/error.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.handler.base import BaseHandler +from aiogram.handlers.base import BaseHandler class ErrorHandler(BaseHandler[Exception], ABC): diff --git a/aiogram/handler/inline_query.py b/aiogram/handlers/inline_query.py similarity index 89% rename from aiogram/handler/inline_query.py rename to aiogram/handlers/inline_query.py index ae08dd82..022d8f28 100644 --- a/aiogram/handler/inline_query.py +++ b/aiogram/handlers/inline_query.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import InlineQuery, User diff --git a/aiogram/handler/message.py b/aiogram/handlers/message.py similarity index 91% rename from aiogram/handler/message.py rename to aiogram/handlers/message.py index 7058a30b..4fbecec2 100644 --- a/aiogram/handler/message.py +++ b/aiogram/handlers/message.py @@ -2,7 +2,7 @@ from abc import ABC from typing import Optional, cast from aiogram.filters import CommandObject -from aiogram.handler.base import BaseHandler, BaseHandlerMixin +from aiogram.handlers.base import BaseHandler, BaseHandlerMixin from aiogram.types import Chat, Message, User diff --git a/aiogram/handler/poll.py b/aiogram/handlers/poll.py similarity index 89% rename from aiogram/handler/poll.py rename to aiogram/handlers/poll.py index 6449f7fd..2183d844 100644 --- a/aiogram/handler/poll.py +++ b/aiogram/handlers/poll.py @@ -1,7 +1,7 @@ from abc import ABC from typing import List -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import Poll, PollOption diff --git a/aiogram/handler/pre_checkout_query.py b/aiogram/handlers/pre_checkout_query.py similarity index 87% rename from aiogram/handler/pre_checkout_query.py rename to aiogram/handlers/pre_checkout_query.py index b7d77b98..34290f20 100644 --- a/aiogram/handler/pre_checkout_query.py +++ b/aiogram/handlers/pre_checkout_query.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import PreCheckoutQuery, User diff --git a/aiogram/handler/shipping_query.py b/aiogram/handlers/shipping_query.py similarity index 86% rename from aiogram/handler/shipping_query.py rename to aiogram/handlers/shipping_query.py index a41037d0..64a56450 100644 --- a/aiogram/handler/shipping_query.py +++ b/aiogram/handlers/shipping_query.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import ShippingQuery, User diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index 70b5bc63..63f82d60 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -14,6 +14,8 @@ __all__ = ( "TextDecoration", "html_decoration", "markdown_decoration", + "add_surrogates", + "remove_surrogates", ) diff --git a/tests/test_dispatcher/test_event/test_handler.py b/tests/test_dispatcher/test_event/test_handler.py index a54ec8b4..2bdbd880 100644 --- a/tests/test_dispatcher/test_event/test_handler.py +++ b/tests/test_dispatcher/test_event/test_handler.py @@ -6,7 +6,7 @@ import pytest from aiogram import F from aiogram.dispatcher.event.handler import CallableMixin, FilterObject, HandlerObject from aiogram.filters import BaseFilter -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import Update pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_base.py b/tests/test_handler/test_base.py index e889e48c..96cdea00 100644 --- a/tests/test_handler/test_base.py +++ b/tests/test_handler/test_base.py @@ -7,7 +7,7 @@ import pytest from aiogram import Bot from aiogram.dispatcher.event.handler import HandlerObject -from aiogram.handler import BaseHandler +from aiogram.handlers import BaseHandler from aiogram.types import Chat, Message, Update pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_callback_query.py b/tests/test_handler/test_callback_query.py index 103dfe91..345d098f 100644 --- a/tests/test_handler/test_callback_query.py +++ b/tests/test_handler/test_callback_query.py @@ -2,7 +2,7 @@ from typing import Any import pytest -from aiogram.handler import CallbackQueryHandler +from aiogram.handlers import CallbackQueryHandler from aiogram.types import CallbackQuery, User pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_chat_member.py b/tests/test_handler/test_chat_member.py index 7c10233d..85562c7c 100644 --- a/tests/test_handler/test_chat_member.py +++ b/tests/test_handler/test_chat_member.py @@ -3,7 +3,7 @@ from typing import Any import pytest -from aiogram.handler import ChatMemberHandler +from aiogram.handlers import ChatMemberHandler from aiogram.types import Chat, ChatMemberMember, ChatMemberUpdated, User pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_chosen_inline_result.py b/tests/test_handler/test_chosen_inline_result.py index c1877196..3e1c09bc 100644 --- a/tests/test_handler/test_chosen_inline_result.py +++ b/tests/test_handler/test_chosen_inline_result.py @@ -2,7 +2,7 @@ from typing import Any import pytest -from aiogram.handler import ChosenInlineResultHandler +from aiogram.handlers import ChosenInlineResultHandler from aiogram.types import ChosenInlineResult, User pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_error.py b/tests/test_handler/test_error.py index a52e96b5..4d1dc3aa 100644 --- a/tests/test_handler/test_error.py +++ b/tests/test_handler/test_error.py @@ -2,7 +2,7 @@ from typing import Any import pytest -from aiogram.handler import ErrorHandler +from aiogram.handlers import ErrorHandler pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_inline_query.py b/tests/test_handler/test_inline_query.py index 39cf3671..8201db33 100644 --- a/tests/test_handler/test_inline_query.py +++ b/tests/test_handler/test_inline_query.py @@ -2,7 +2,7 @@ from typing import Any import pytest -from aiogram.handler import InlineQueryHandler +from aiogram.handlers import InlineQueryHandler from aiogram.types import InlineQuery, User pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_message.py b/tests/test_handler/test_message.py index e3be7101..eef3be01 100644 --- a/tests/test_handler/test_message.py +++ b/tests/test_handler/test_message.py @@ -4,7 +4,7 @@ from typing import Any import pytest from aiogram.filters import CommandObject -from aiogram.handler import MessageHandler, MessageHandlerCommandMixin +from aiogram.handlers import MessageHandler, MessageHandlerCommandMixin from aiogram.types import Chat, Message, User pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_poll.py b/tests/test_handler/test_poll.py index e9c8ba88..4d4c2835 100644 --- a/tests/test_handler/test_poll.py +++ b/tests/test_handler/test_poll.py @@ -2,7 +2,7 @@ from typing import Any import pytest -from aiogram.handler import PollHandler +from aiogram.handlers import PollHandler from aiogram.types import Poll, PollOption pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_pre_checkout_query.py b/tests/test_handler/test_pre_checkout_query.py index 76d52b59..26b26f81 100644 --- a/tests/test_handler/test_pre_checkout_query.py +++ b/tests/test_handler/test_pre_checkout_query.py @@ -2,7 +2,7 @@ from typing import Any import pytest -from aiogram.handler import PreCheckoutQueryHandler +from aiogram.handlers import PreCheckoutQueryHandler from aiogram.types import PreCheckoutQuery, User pytestmark = pytest.mark.asyncio diff --git a/tests/test_handler/test_shipping_query.py b/tests/test_handler/test_shipping_query.py index 28e0c7b2..7113cdef 100644 --- a/tests/test_handler/test_shipping_query.py +++ b/tests/test_handler/test_shipping_query.py @@ -2,7 +2,7 @@ from typing import Any import pytest -from aiogram.handler import ShippingQueryHandler +from aiogram.handlers import ShippingQueryHandler from aiogram.types import ShippingAddress, ShippingQuery, User pytestmark = pytest.mark.asyncio