diff --git a/aiogram/__init__.py b/aiogram/__init__.py index 435b4eaf..0d751e51 100644 --- a/aiogram/__init__.py +++ b/aiogram/__init__.py @@ -1,6 +1,5 @@ -from .api import methods, types -from .api.client import session -from .api.client.bot import Bot +from .client import session +from .client.bot import Bot from .dispatcher import filters, handler from .dispatcher.dispatcher import Dispatcher from .dispatcher.middlewares.base import BaseMiddleware @@ -28,5 +27,5 @@ __all__ = ( "handler", ) -__version__ = "3.0.0a5" -__api_version__ = "4.9" +__version__ = "3.0.0a6" +__api_version__ = "5.0" diff --git a/aiogram/api/client/session/__init__.py b/aiogram/api/client/session/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/aiogram/api/__init__.py b/aiogram/client/__init__.py similarity index 100% rename from aiogram/api/__init__.py rename to aiogram/client/__init__.py diff --git a/aiogram/api/client/bot.py b/aiogram/client/bot.py similarity index 99% rename from aiogram/api/client/bot.py rename to aiogram/client/bot.py index aa0666c0..6030dd5a 100644 --- a/aiogram/api/client/bot.py +++ b/aiogram/client/bot.py @@ -19,8 +19,9 @@ from typing import ( import aiofiles from async_lru import alru_cache -from ...utils.mixins import ContextInstanceMixin -from ...utils.token import extract_bot_id, validate_token +from aiogram.utils.mixins import ContextInstanceMixin +from aiogram.utils.token import extract_bot_id, validate_token + from ..methods import ( AddStickerToSet, AnswerCallbackQuery, @@ -104,6 +105,7 @@ from ..types import ( Chat, ChatMember, ChatPermissions, + Downloadable, File, ForceReply, GameHighScore, diff --git a/aiogram/api/client/__init__.py b/aiogram/client/session/__init__.py similarity index 100% rename from aiogram/api/client/__init__.py rename to aiogram/client/session/__init__.py diff --git a/aiogram/api/client/session/aiohttp.py b/aiogram/client/session/aiohttp.py similarity index 98% rename from aiogram/api/client/session/aiohttp.py rename to aiogram/client/session/aiohttp.py index 1fda8bbf..96e88bac 100644 --- a/aiogram/api/client/session/aiohttp.py +++ b/aiogram/client/session/aiohttp.py @@ -17,7 +17,7 @@ from typing import ( from aiohttp import BasicAuth, ClientSession, FormData, TCPConnector -from aiogram.api.methods import Request, TelegramMethod +from aiogram.methods import Request, TelegramMethod from .base import BaseSession diff --git a/aiogram/api/client/session/base.py b/aiogram/client/session/base.py similarity index 98% rename from aiogram/api/client/session/base.py rename to aiogram/client/session/base.py index d1249733..50beee50 100644 --- a/aiogram/api/client/session/base.py +++ b/aiogram/client/session/base.py @@ -18,7 +18,7 @@ from typing import ( from aiogram.utils.exceptions import TelegramAPIError -from ....utils.helper import Default +from aiogram.utils.helper import Default from ...methods import Response, TelegramMethod from ...types import UNSET from ..telegram import PRODUCTION, TelegramAPIServer diff --git a/aiogram/api/client/telegram.py b/aiogram/client/telegram.py similarity index 95% rename from aiogram/api/client/telegram.py rename to aiogram/client/telegram.py index 97775e03..db653249 100644 --- a/aiogram/api/client/telegram.py +++ b/aiogram/client/telegram.py @@ -12,7 +12,7 @@ class TelegramAPIServer: def api_url(self, token: str, method: str) -> str: """ - Generate URL for API methods + Generate URL for methods :param token: Bot token :param method: API method name (case insensitive) diff --git a/aiogram/dispatcher/dispatcher.py b/aiogram/dispatcher/dispatcher.py index bee4af18..c780e397 100644 --- a/aiogram/dispatcher/dispatcher.py +++ b/aiogram/dispatcher/dispatcher.py @@ -7,9 +7,9 @@ from asyncio import CancelledError, Future, Lock from typing import Any, AsyncGenerator, Dict, Optional, Union from .. import loggers -from ..api.client.bot import Bot -from ..api.methods import TelegramMethod -from ..api.types import Update, User +from aiogram.client.bot import Bot +from ..methods import TelegramMethod +from ..types import Update, User from ..utils.exceptions import TelegramAPIError from .event.bases import NOT_HANDLED from .middlewares.user_context import UserContextMiddleware diff --git a/aiogram/dispatcher/event/bases.py b/aiogram/dispatcher/event/bases.py index d255e3ae..3166dac5 100644 --- a/aiogram/dispatcher/event/bases.py +++ b/aiogram/dispatcher/event/bases.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Any, Awaitable, Callable, Dict, NoReturn, Optional, Union from unittest.mock import sentinel -from ...api.types import TelegramObject +from ...types import TelegramObject from ..middlewares.base import BaseMiddleware NextMiddlewareType = Callable[[TelegramObject, Dict[str, Any]], Awaitable[Any]] diff --git a/aiogram/dispatcher/event/telegram.py b/aiogram/dispatcher/event/telegram.py index e72d5db3..fe40769c 100644 --- a/aiogram/dispatcher/event/telegram.py +++ b/aiogram/dispatcher/event/telegram.py @@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, List, Optional from pydantic import ValidationError -from ...api.types import TelegramObject +from ...types import TelegramObject from ..filters.base import BaseFilter from .bases import NOT_HANDLED, MiddlewareType, NextMiddlewareType, SkipHandler from .handler import CallbackType, FilterObject, FilterType, HandlerObject, HandlerType diff --git a/aiogram/dispatcher/filters/command.py b/aiogram/dispatcher/filters/command.py index 7d0c05f8..22327909 100644 --- a/aiogram/dispatcher/filters/command.py +++ b/aiogram/dispatcher/filters/command.py @@ -7,7 +7,7 @@ from typing import Any, Dict, Match, Optional, Pattern, Sequence, Union, cast from pydantic import validator from aiogram import Bot -from aiogram.api.types import Message +from aiogram.types import Message from aiogram.dispatcher.filters import BaseFilter CommandPatterType = Union[str, re.Pattern] diff --git a/aiogram/dispatcher/filters/content_types.py b/aiogram/dispatcher/filters/content_types.py index 1f195663..8b6ed9d3 100644 --- a/aiogram/dispatcher/filters/content_types.py +++ b/aiogram/dispatcher/filters/content_types.py @@ -2,8 +2,8 @@ from typing import Any, Dict, Optional, Sequence, Union from pydantic import validator -from ...api.types import Message -from ...api.types.message import ContentType +from ...types import Message +from aiogram.types.message import ContentType from .base import BaseFilter diff --git a/aiogram/dispatcher/filters/text.py b/aiogram/dispatcher/filters/text.py index 8ab3822d..d9692613 100644 --- a/aiogram/dispatcher/filters/text.py +++ b/aiogram/dispatcher/filters/text.py @@ -2,7 +2,7 @@ from typing import Any, Dict, Optional, Sequence, Union from pydantic import root_validator -from aiogram.api.types import CallbackQuery, InlineQuery, Message, Poll +from aiogram.types import CallbackQuery, InlineQuery, Message, Poll from aiogram.dispatcher.filters import BaseFilter TextType = str diff --git a/aiogram/dispatcher/handler/base.py b/aiogram/dispatcher/handler/base.py index 90b8da45..6e26250b 100644 --- a/aiogram/dispatcher/handler/base.py +++ b/aiogram/dispatcher/handler/base.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, Dict, Generic, TypeVar, cast from aiogram import Bot -from aiogram.api.types import Update +from aiogram.types import Update T = TypeVar("T") diff --git a/aiogram/dispatcher/handler/callback_query.py b/aiogram/dispatcher/handler/callback_query.py index a7faa0d3..7bbf5354 100644 --- a/aiogram/dispatcher/handler/callback_query.py +++ b/aiogram/dispatcher/handler/callback_query.py @@ -1,7 +1,7 @@ from abc import ABC from typing import Optional -from aiogram.api.types import CallbackQuery, Message, User +from aiogram.types import CallbackQuery, Message, User from aiogram.dispatcher.handler import BaseHandler diff --git a/aiogram/dispatcher/handler/chosen_inline_result.py b/aiogram/dispatcher/handler/chosen_inline_result.py index b15469bf..820b2ced 100644 --- a/aiogram/dispatcher/handler/chosen_inline_result.py +++ b/aiogram/dispatcher/handler/chosen_inline_result.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.api.types import ChosenInlineResult, User +from aiogram.types import ChosenInlineResult, User from aiogram.dispatcher.handler import BaseHandler diff --git a/aiogram/dispatcher/handler/inline_query.py b/aiogram/dispatcher/handler/inline_query.py index faae2d23..8858a664 100644 --- a/aiogram/dispatcher/handler/inline_query.py +++ b/aiogram/dispatcher/handler/inline_query.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.api.types import InlineQuery, User +from aiogram.types import InlineQuery, User from aiogram.dispatcher.handler import BaseHandler diff --git a/aiogram/dispatcher/handler/message.py b/aiogram/dispatcher/handler/message.py index a25daddc..7d38fde0 100644 --- a/aiogram/dispatcher/handler/message.py +++ b/aiogram/dispatcher/handler/message.py @@ -1,7 +1,7 @@ from abc import ABC from typing import Optional, cast -from aiogram.api.types import Chat, Message, User +from aiogram.types import Chat, Message, User from aiogram.dispatcher.filters import CommandObject from aiogram.dispatcher.handler.base import BaseHandler, BaseHandlerMixin diff --git a/aiogram/dispatcher/handler/poll.py b/aiogram/dispatcher/handler/poll.py index 27883738..19a0ab55 100644 --- a/aiogram/dispatcher/handler/poll.py +++ b/aiogram/dispatcher/handler/poll.py @@ -1,7 +1,7 @@ from abc import ABC from typing import List -from aiogram.api.types import Poll, PollOption +from aiogram.types import Poll, PollOption from aiogram.dispatcher.handler import BaseHandler diff --git a/aiogram/dispatcher/handler/pre_checkout_query.py b/aiogram/dispatcher/handler/pre_checkout_query.py index 02fae71c..ab746626 100644 --- a/aiogram/dispatcher/handler/pre_checkout_query.py +++ b/aiogram/dispatcher/handler/pre_checkout_query.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.api.types import PreCheckoutQuery, User +from aiogram.types import PreCheckoutQuery, User from aiogram.dispatcher.handler import BaseHandler diff --git a/aiogram/dispatcher/handler/shipping_query.py b/aiogram/dispatcher/handler/shipping_query.py index ea079a23..ddce4f16 100644 --- a/aiogram/dispatcher/handler/shipping_query.py +++ b/aiogram/dispatcher/handler/shipping_query.py @@ -1,6 +1,6 @@ from abc import ABC -from aiogram.api.types import ShippingQuery, User +from aiogram.types import ShippingQuery, User from aiogram.dispatcher.handler import BaseHandler diff --git a/aiogram/dispatcher/middlewares/error.py b/aiogram/dispatcher/middlewares/error.py index 438277b1..49606eaf 100644 --- a/aiogram/dispatcher/middlewares/error.py +++ b/aiogram/dispatcher/middlewares/error.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict -from ...api.types import Update +from ...types import Update from ..event.bases import NOT_HANDLED, CancelHandler, SkipHandler from .base import BaseMiddleware diff --git a/aiogram/dispatcher/middlewares/user_context.py b/aiogram/dispatcher/middlewares/user_context.py index 09abd10f..aa978bab 100644 --- a/aiogram/dispatcher/middlewares/user_context.py +++ b/aiogram/dispatcher/middlewares/user_context.py @@ -1,7 +1,7 @@ from contextlib import contextmanager from typing import Any, Awaitable, Callable, Dict, Iterator, Optional, Tuple -from aiogram.api.types import Chat, Update, User +from aiogram.types import Chat, Update, User from aiogram.dispatcher.middlewares.base import BaseMiddleware diff --git a/aiogram/dispatcher/router.py b/aiogram/dispatcher/router.py index 7680454e..1d4ff979 100644 --- a/aiogram/dispatcher/router.py +++ b/aiogram/dispatcher/router.py @@ -3,7 +3,7 @@ from __future__ import annotations import warnings from typing import Any, Dict, Generator, List, Optional, Union -from ..api.types import TelegramObject, Update +from ..types import TelegramObject, Update from ..utils.imports import import_module from ..utils.warnings import CodeHasNoEffect from .event.bases import NOT_HANDLED, SkipHandler diff --git a/aiogram/api/methods/__init__.py b/aiogram/methods/__init__.py similarity index 100% rename from aiogram/api/methods/__init__.py rename to aiogram/methods/__init__.py diff --git a/aiogram/api/methods/add_sticker_to_set.py b/aiogram/methods/add_sticker_to_set.py similarity index 100% rename from aiogram/api/methods/add_sticker_to_set.py rename to aiogram/methods/add_sticker_to_set.py diff --git a/aiogram/api/methods/answer_callback_query.py b/aiogram/methods/answer_callback_query.py similarity index 100% rename from aiogram/api/methods/answer_callback_query.py rename to aiogram/methods/answer_callback_query.py diff --git a/aiogram/api/methods/answer_inline_query.py b/aiogram/methods/answer_inline_query.py similarity index 100% rename from aiogram/api/methods/answer_inline_query.py rename to aiogram/methods/answer_inline_query.py diff --git a/aiogram/api/methods/answer_pre_checkout_query.py b/aiogram/methods/answer_pre_checkout_query.py similarity index 100% rename from aiogram/api/methods/answer_pre_checkout_query.py rename to aiogram/methods/answer_pre_checkout_query.py diff --git a/aiogram/api/methods/answer_shipping_query.py b/aiogram/methods/answer_shipping_query.py similarity index 100% rename from aiogram/api/methods/answer_shipping_query.py rename to aiogram/methods/answer_shipping_query.py diff --git a/aiogram/api/methods/base.py b/aiogram/methods/base.py similarity index 99% rename from aiogram/api/methods/base.py rename to aiogram/methods/base.py index 4a78cbee..ce73a35b 100644 --- a/aiogram/api/methods/base.py +++ b/aiogram/methods/base.py @@ -84,7 +84,7 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[T]): return await bot(self) def __await__(self) -> Generator[Any, None, T]: - from aiogram.api.client.bot import Bot + from aiogram.client.bot import Bot bot = Bot.get_current(no_error=False) return self.emit(bot).__await__() diff --git a/aiogram/api/methods/close.py b/aiogram/methods/close.py similarity index 100% rename from aiogram/api/methods/close.py rename to aiogram/methods/close.py diff --git a/aiogram/api/methods/copy_message.py b/aiogram/methods/copy_message.py similarity index 100% rename from aiogram/api/methods/copy_message.py rename to aiogram/methods/copy_message.py diff --git a/aiogram/api/methods/create_new_sticker_set.py b/aiogram/methods/create_new_sticker_set.py similarity index 100% rename from aiogram/api/methods/create_new_sticker_set.py rename to aiogram/methods/create_new_sticker_set.py diff --git a/aiogram/api/methods/delete_chat_photo.py b/aiogram/methods/delete_chat_photo.py similarity index 100% rename from aiogram/api/methods/delete_chat_photo.py rename to aiogram/methods/delete_chat_photo.py diff --git a/aiogram/api/methods/delete_chat_sticker_set.py b/aiogram/methods/delete_chat_sticker_set.py similarity index 100% rename from aiogram/api/methods/delete_chat_sticker_set.py rename to aiogram/methods/delete_chat_sticker_set.py diff --git a/aiogram/api/methods/delete_message.py b/aiogram/methods/delete_message.py similarity index 100% rename from aiogram/api/methods/delete_message.py rename to aiogram/methods/delete_message.py diff --git a/aiogram/api/methods/delete_sticker_from_set.py b/aiogram/methods/delete_sticker_from_set.py similarity index 100% rename from aiogram/api/methods/delete_sticker_from_set.py rename to aiogram/methods/delete_sticker_from_set.py diff --git a/aiogram/api/methods/delete_webhook.py b/aiogram/methods/delete_webhook.py similarity index 100% rename from aiogram/api/methods/delete_webhook.py rename to aiogram/methods/delete_webhook.py diff --git a/aiogram/api/methods/edit_message_caption.py b/aiogram/methods/edit_message_caption.py similarity index 100% rename from aiogram/api/methods/edit_message_caption.py rename to aiogram/methods/edit_message_caption.py diff --git a/aiogram/api/methods/edit_message_live_location.py b/aiogram/methods/edit_message_live_location.py similarity index 100% rename from aiogram/api/methods/edit_message_live_location.py rename to aiogram/methods/edit_message_live_location.py diff --git a/aiogram/api/methods/edit_message_media.py b/aiogram/methods/edit_message_media.py similarity index 100% rename from aiogram/api/methods/edit_message_media.py rename to aiogram/methods/edit_message_media.py diff --git a/aiogram/api/methods/edit_message_reply_markup.py b/aiogram/methods/edit_message_reply_markup.py similarity index 100% rename from aiogram/api/methods/edit_message_reply_markup.py rename to aiogram/methods/edit_message_reply_markup.py diff --git a/aiogram/api/methods/edit_message_text.py b/aiogram/methods/edit_message_text.py similarity index 100% rename from aiogram/api/methods/edit_message_text.py rename to aiogram/methods/edit_message_text.py diff --git a/aiogram/api/methods/export_chat_invite_link.py b/aiogram/methods/export_chat_invite_link.py similarity index 100% rename from aiogram/api/methods/export_chat_invite_link.py rename to aiogram/methods/export_chat_invite_link.py diff --git a/aiogram/api/methods/forward_message.py b/aiogram/methods/forward_message.py similarity index 100% rename from aiogram/api/methods/forward_message.py rename to aiogram/methods/forward_message.py diff --git a/aiogram/api/methods/get_chat.py b/aiogram/methods/get_chat.py similarity index 100% rename from aiogram/api/methods/get_chat.py rename to aiogram/methods/get_chat.py diff --git a/aiogram/api/methods/get_chat_administrators.py b/aiogram/methods/get_chat_administrators.py similarity index 100% rename from aiogram/api/methods/get_chat_administrators.py rename to aiogram/methods/get_chat_administrators.py diff --git a/aiogram/api/methods/get_chat_member.py b/aiogram/methods/get_chat_member.py similarity index 100% rename from aiogram/api/methods/get_chat_member.py rename to aiogram/methods/get_chat_member.py diff --git a/aiogram/api/methods/get_chat_members_count.py b/aiogram/methods/get_chat_members_count.py similarity index 100% rename from aiogram/api/methods/get_chat_members_count.py rename to aiogram/methods/get_chat_members_count.py diff --git a/aiogram/api/methods/get_file.py b/aiogram/methods/get_file.py similarity index 100% rename from aiogram/api/methods/get_file.py rename to aiogram/methods/get_file.py diff --git a/aiogram/api/methods/get_game_high_scores.py b/aiogram/methods/get_game_high_scores.py similarity index 100% rename from aiogram/api/methods/get_game_high_scores.py rename to aiogram/methods/get_game_high_scores.py diff --git a/aiogram/api/methods/get_me.py b/aiogram/methods/get_me.py similarity index 100% rename from aiogram/api/methods/get_me.py rename to aiogram/methods/get_me.py diff --git a/aiogram/api/methods/get_my_commands.py b/aiogram/methods/get_my_commands.py similarity index 100% rename from aiogram/api/methods/get_my_commands.py rename to aiogram/methods/get_my_commands.py diff --git a/aiogram/api/methods/get_sticker_set.py b/aiogram/methods/get_sticker_set.py similarity index 100% rename from aiogram/api/methods/get_sticker_set.py rename to aiogram/methods/get_sticker_set.py diff --git a/aiogram/api/methods/get_updates.py b/aiogram/methods/get_updates.py similarity index 100% rename from aiogram/api/methods/get_updates.py rename to aiogram/methods/get_updates.py diff --git a/aiogram/api/methods/get_user_profile_photos.py b/aiogram/methods/get_user_profile_photos.py similarity index 100% rename from aiogram/api/methods/get_user_profile_photos.py rename to aiogram/methods/get_user_profile_photos.py diff --git a/aiogram/api/methods/get_webhook_info.py b/aiogram/methods/get_webhook_info.py similarity index 100% rename from aiogram/api/methods/get_webhook_info.py rename to aiogram/methods/get_webhook_info.py diff --git a/aiogram/api/methods/kick_chat_member.py b/aiogram/methods/kick_chat_member.py similarity index 100% rename from aiogram/api/methods/kick_chat_member.py rename to aiogram/methods/kick_chat_member.py diff --git a/aiogram/api/methods/leave_chat.py b/aiogram/methods/leave_chat.py similarity index 100% rename from aiogram/api/methods/leave_chat.py rename to aiogram/methods/leave_chat.py diff --git a/aiogram/api/methods/log_out.py b/aiogram/methods/log_out.py similarity index 100% rename from aiogram/api/methods/log_out.py rename to aiogram/methods/log_out.py diff --git a/aiogram/api/methods/pin_chat_message.py b/aiogram/methods/pin_chat_message.py similarity index 100% rename from aiogram/api/methods/pin_chat_message.py rename to aiogram/methods/pin_chat_message.py diff --git a/aiogram/api/methods/promote_chat_member.py b/aiogram/methods/promote_chat_member.py similarity index 100% rename from aiogram/api/methods/promote_chat_member.py rename to aiogram/methods/promote_chat_member.py diff --git a/aiogram/api/methods/restrict_chat_member.py b/aiogram/methods/restrict_chat_member.py similarity index 100% rename from aiogram/api/methods/restrict_chat_member.py rename to aiogram/methods/restrict_chat_member.py diff --git a/aiogram/api/methods/send_animation.py b/aiogram/methods/send_animation.py similarity index 100% rename from aiogram/api/methods/send_animation.py rename to aiogram/methods/send_animation.py diff --git a/aiogram/api/methods/send_audio.py b/aiogram/methods/send_audio.py similarity index 100% rename from aiogram/api/methods/send_audio.py rename to aiogram/methods/send_audio.py diff --git a/aiogram/api/methods/send_chat_action.py b/aiogram/methods/send_chat_action.py similarity index 100% rename from aiogram/api/methods/send_chat_action.py rename to aiogram/methods/send_chat_action.py diff --git a/aiogram/api/methods/send_contact.py b/aiogram/methods/send_contact.py similarity index 100% rename from aiogram/api/methods/send_contact.py rename to aiogram/methods/send_contact.py diff --git a/aiogram/api/methods/send_dice.py b/aiogram/methods/send_dice.py similarity index 100% rename from aiogram/api/methods/send_dice.py rename to aiogram/methods/send_dice.py diff --git a/aiogram/api/methods/send_document.py b/aiogram/methods/send_document.py similarity index 100% rename from aiogram/api/methods/send_document.py rename to aiogram/methods/send_document.py diff --git a/aiogram/api/methods/send_game.py b/aiogram/methods/send_game.py similarity index 100% rename from aiogram/api/methods/send_game.py rename to aiogram/methods/send_game.py diff --git a/aiogram/api/methods/send_invoice.py b/aiogram/methods/send_invoice.py similarity index 100% rename from aiogram/api/methods/send_invoice.py rename to aiogram/methods/send_invoice.py diff --git a/aiogram/api/methods/send_location.py b/aiogram/methods/send_location.py similarity index 100% rename from aiogram/api/methods/send_location.py rename to aiogram/methods/send_location.py diff --git a/aiogram/api/methods/send_media_group.py b/aiogram/methods/send_media_group.py similarity index 100% rename from aiogram/api/methods/send_media_group.py rename to aiogram/methods/send_media_group.py diff --git a/aiogram/api/methods/send_message.py b/aiogram/methods/send_message.py similarity index 100% rename from aiogram/api/methods/send_message.py rename to aiogram/methods/send_message.py diff --git a/aiogram/api/methods/send_photo.py b/aiogram/methods/send_photo.py similarity index 100% rename from aiogram/api/methods/send_photo.py rename to aiogram/methods/send_photo.py diff --git a/aiogram/api/methods/send_poll.py b/aiogram/methods/send_poll.py similarity index 100% rename from aiogram/api/methods/send_poll.py rename to aiogram/methods/send_poll.py diff --git a/aiogram/api/methods/send_sticker.py b/aiogram/methods/send_sticker.py similarity index 100% rename from aiogram/api/methods/send_sticker.py rename to aiogram/methods/send_sticker.py diff --git a/aiogram/api/methods/send_venue.py b/aiogram/methods/send_venue.py similarity index 100% rename from aiogram/api/methods/send_venue.py rename to aiogram/methods/send_venue.py diff --git a/aiogram/api/methods/send_video.py b/aiogram/methods/send_video.py similarity index 100% rename from aiogram/api/methods/send_video.py rename to aiogram/methods/send_video.py diff --git a/aiogram/api/methods/send_video_note.py b/aiogram/methods/send_video_note.py similarity index 100% rename from aiogram/api/methods/send_video_note.py rename to aiogram/methods/send_video_note.py diff --git a/aiogram/api/methods/send_voice.py b/aiogram/methods/send_voice.py similarity index 100% rename from aiogram/api/methods/send_voice.py rename to aiogram/methods/send_voice.py diff --git a/aiogram/api/methods/set_chat_administrator_custom_title.py b/aiogram/methods/set_chat_administrator_custom_title.py similarity index 100% rename from aiogram/api/methods/set_chat_administrator_custom_title.py rename to aiogram/methods/set_chat_administrator_custom_title.py diff --git a/aiogram/api/methods/set_chat_description.py b/aiogram/methods/set_chat_description.py similarity index 100% rename from aiogram/api/methods/set_chat_description.py rename to aiogram/methods/set_chat_description.py diff --git a/aiogram/api/methods/set_chat_permissions.py b/aiogram/methods/set_chat_permissions.py similarity index 100% rename from aiogram/api/methods/set_chat_permissions.py rename to aiogram/methods/set_chat_permissions.py diff --git a/aiogram/api/methods/set_chat_photo.py b/aiogram/methods/set_chat_photo.py similarity index 100% rename from aiogram/api/methods/set_chat_photo.py rename to aiogram/methods/set_chat_photo.py diff --git a/aiogram/api/methods/set_chat_sticker_set.py b/aiogram/methods/set_chat_sticker_set.py similarity index 100% rename from aiogram/api/methods/set_chat_sticker_set.py rename to aiogram/methods/set_chat_sticker_set.py diff --git a/aiogram/api/methods/set_chat_title.py b/aiogram/methods/set_chat_title.py similarity index 100% rename from aiogram/api/methods/set_chat_title.py rename to aiogram/methods/set_chat_title.py diff --git a/aiogram/api/methods/set_game_score.py b/aiogram/methods/set_game_score.py similarity index 100% rename from aiogram/api/methods/set_game_score.py rename to aiogram/methods/set_game_score.py diff --git a/aiogram/api/methods/set_my_commands.py b/aiogram/methods/set_my_commands.py similarity index 100% rename from aiogram/api/methods/set_my_commands.py rename to aiogram/methods/set_my_commands.py diff --git a/aiogram/api/methods/set_passport_data_errors.py b/aiogram/methods/set_passport_data_errors.py similarity index 100% rename from aiogram/api/methods/set_passport_data_errors.py rename to aiogram/methods/set_passport_data_errors.py diff --git a/aiogram/api/methods/set_sticker_position_in_set.py b/aiogram/methods/set_sticker_position_in_set.py similarity index 100% rename from aiogram/api/methods/set_sticker_position_in_set.py rename to aiogram/methods/set_sticker_position_in_set.py diff --git a/aiogram/api/methods/set_sticker_set_thumb.py b/aiogram/methods/set_sticker_set_thumb.py similarity index 100% rename from aiogram/api/methods/set_sticker_set_thumb.py rename to aiogram/methods/set_sticker_set_thumb.py diff --git a/aiogram/api/methods/set_webhook.py b/aiogram/methods/set_webhook.py similarity index 100% rename from aiogram/api/methods/set_webhook.py rename to aiogram/methods/set_webhook.py diff --git a/aiogram/api/methods/stop_message_live_location.py b/aiogram/methods/stop_message_live_location.py similarity index 100% rename from aiogram/api/methods/stop_message_live_location.py rename to aiogram/methods/stop_message_live_location.py diff --git a/aiogram/api/methods/stop_poll.py b/aiogram/methods/stop_poll.py similarity index 100% rename from aiogram/api/methods/stop_poll.py rename to aiogram/methods/stop_poll.py diff --git a/aiogram/api/methods/unban_chat_member.py b/aiogram/methods/unban_chat_member.py similarity index 100% rename from aiogram/api/methods/unban_chat_member.py rename to aiogram/methods/unban_chat_member.py diff --git a/aiogram/api/methods/unpin_all_chat_messages.py b/aiogram/methods/unpin_all_chat_messages.py similarity index 100% rename from aiogram/api/methods/unpin_all_chat_messages.py rename to aiogram/methods/unpin_all_chat_messages.py diff --git a/aiogram/api/methods/unpin_chat_message.py b/aiogram/methods/unpin_chat_message.py similarity index 100% rename from aiogram/api/methods/unpin_chat_message.py rename to aiogram/methods/unpin_chat_message.py diff --git a/aiogram/api/methods/upload_sticker_file.py b/aiogram/methods/upload_sticker_file.py similarity index 100% rename from aiogram/api/methods/upload_sticker_file.py rename to aiogram/methods/upload_sticker_file.py diff --git a/aiogram/api/types/__init__.py b/aiogram/types/__init__.py similarity index 100% rename from aiogram/api/types/__init__.py rename to aiogram/types/__init__.py diff --git a/aiogram/api/types/animation.py b/aiogram/types/animation.py similarity index 100% rename from aiogram/api/types/animation.py rename to aiogram/types/animation.py diff --git a/aiogram/api/types/audio.py b/aiogram/types/audio.py similarity index 100% rename from aiogram/api/types/audio.py rename to aiogram/types/audio.py diff --git a/aiogram/api/types/base.py b/aiogram/types/base.py similarity index 100% rename from aiogram/api/types/base.py rename to aiogram/types/base.py diff --git a/aiogram/api/types/bot_command.py b/aiogram/types/bot_command.py similarity index 100% rename from aiogram/api/types/bot_command.py rename to aiogram/types/bot_command.py diff --git a/aiogram/api/types/callback_game.py b/aiogram/types/callback_game.py similarity index 100% rename from aiogram/api/types/callback_game.py rename to aiogram/types/callback_game.py diff --git a/aiogram/api/types/callback_query.py b/aiogram/types/callback_query.py similarity index 100% rename from aiogram/api/types/callback_query.py rename to aiogram/types/callback_query.py diff --git a/aiogram/api/types/chat.py b/aiogram/types/chat.py similarity index 100% rename from aiogram/api/types/chat.py rename to aiogram/types/chat.py diff --git a/aiogram/api/types/chat_location.py b/aiogram/types/chat_location.py similarity index 100% rename from aiogram/api/types/chat_location.py rename to aiogram/types/chat_location.py diff --git a/aiogram/api/types/chat_member.py b/aiogram/types/chat_member.py similarity index 99% rename from aiogram/api/types/chat_member.py rename to aiogram/types/chat_member.py index 35f0a542..042de8b2 100644 --- a/aiogram/api/types/chat_member.py +++ b/aiogram/types/chat_member.py @@ -3,7 +3,7 @@ from __future__ import annotations import datetime from typing import TYPE_CHECKING, Optional, Union -from ...utils import helper +from aiogram.utils import helper from .base import TelegramObject if TYPE_CHECKING: # pragma: no cover diff --git a/aiogram/api/types/chat_permissions.py b/aiogram/types/chat_permissions.py similarity index 100% rename from aiogram/api/types/chat_permissions.py rename to aiogram/types/chat_permissions.py diff --git a/aiogram/api/types/chat_photo.py b/aiogram/types/chat_photo.py similarity index 100% rename from aiogram/api/types/chat_photo.py rename to aiogram/types/chat_photo.py diff --git a/aiogram/api/types/chosen_inline_result.py b/aiogram/types/chosen_inline_result.py similarity index 100% rename from aiogram/api/types/chosen_inline_result.py rename to aiogram/types/chosen_inline_result.py diff --git a/aiogram/api/types/contact.py b/aiogram/types/contact.py similarity index 100% rename from aiogram/api/types/contact.py rename to aiogram/types/contact.py diff --git a/aiogram/api/types/dice.py b/aiogram/types/dice.py similarity index 100% rename from aiogram/api/types/dice.py rename to aiogram/types/dice.py diff --git a/aiogram/api/types/document.py b/aiogram/types/document.py similarity index 100% rename from aiogram/api/types/document.py rename to aiogram/types/document.py diff --git a/aiogram/api/types/downloadable.py b/aiogram/types/downloadable.py similarity index 100% rename from aiogram/api/types/downloadable.py rename to aiogram/types/downloadable.py diff --git a/aiogram/api/types/encrypted_credentials.py b/aiogram/types/encrypted_credentials.py similarity index 100% rename from aiogram/api/types/encrypted_credentials.py rename to aiogram/types/encrypted_credentials.py diff --git a/aiogram/api/types/encrypted_passport_element.py b/aiogram/types/encrypted_passport_element.py similarity index 100% rename from aiogram/api/types/encrypted_passport_element.py rename to aiogram/types/encrypted_passport_element.py diff --git a/aiogram/api/types/file.py b/aiogram/types/file.py similarity index 100% rename from aiogram/api/types/file.py rename to aiogram/types/file.py diff --git a/aiogram/api/types/force_reply.py b/aiogram/types/force_reply.py similarity index 100% rename from aiogram/api/types/force_reply.py rename to aiogram/types/force_reply.py diff --git a/aiogram/api/types/game.py b/aiogram/types/game.py similarity index 100% rename from aiogram/api/types/game.py rename to aiogram/types/game.py diff --git a/aiogram/api/types/game_high_score.py b/aiogram/types/game_high_score.py similarity index 100% rename from aiogram/api/types/game_high_score.py rename to aiogram/types/game_high_score.py diff --git a/aiogram/api/types/inline_keyboard_button.py b/aiogram/types/inline_keyboard_button.py similarity index 100% rename from aiogram/api/types/inline_keyboard_button.py rename to aiogram/types/inline_keyboard_button.py diff --git a/aiogram/api/types/inline_keyboard_markup.py b/aiogram/types/inline_keyboard_markup.py similarity index 100% rename from aiogram/api/types/inline_keyboard_markup.py rename to aiogram/types/inline_keyboard_markup.py diff --git a/aiogram/api/types/inline_query.py b/aiogram/types/inline_query.py similarity index 100% rename from aiogram/api/types/inline_query.py rename to aiogram/types/inline_query.py diff --git a/aiogram/api/types/inline_query_result.py b/aiogram/types/inline_query_result.py similarity index 100% rename from aiogram/api/types/inline_query_result.py rename to aiogram/types/inline_query_result.py diff --git a/aiogram/api/types/inline_query_result_article.py b/aiogram/types/inline_query_result_article.py similarity index 100% rename from aiogram/api/types/inline_query_result_article.py rename to aiogram/types/inline_query_result_article.py diff --git a/aiogram/api/types/inline_query_result_audio.py b/aiogram/types/inline_query_result_audio.py similarity index 100% rename from aiogram/api/types/inline_query_result_audio.py rename to aiogram/types/inline_query_result_audio.py diff --git a/aiogram/api/types/inline_query_result_cached_audio.py b/aiogram/types/inline_query_result_cached_audio.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_audio.py rename to aiogram/types/inline_query_result_cached_audio.py diff --git a/aiogram/api/types/inline_query_result_cached_document.py b/aiogram/types/inline_query_result_cached_document.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_document.py rename to aiogram/types/inline_query_result_cached_document.py diff --git a/aiogram/api/types/inline_query_result_cached_gif.py b/aiogram/types/inline_query_result_cached_gif.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_gif.py rename to aiogram/types/inline_query_result_cached_gif.py diff --git a/aiogram/api/types/inline_query_result_cached_mpeg4_gif.py b/aiogram/types/inline_query_result_cached_mpeg4_gif.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_mpeg4_gif.py rename to aiogram/types/inline_query_result_cached_mpeg4_gif.py diff --git a/aiogram/api/types/inline_query_result_cached_photo.py b/aiogram/types/inline_query_result_cached_photo.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_photo.py rename to aiogram/types/inline_query_result_cached_photo.py diff --git a/aiogram/api/types/inline_query_result_cached_sticker.py b/aiogram/types/inline_query_result_cached_sticker.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_sticker.py rename to aiogram/types/inline_query_result_cached_sticker.py diff --git a/aiogram/api/types/inline_query_result_cached_video.py b/aiogram/types/inline_query_result_cached_video.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_video.py rename to aiogram/types/inline_query_result_cached_video.py diff --git a/aiogram/api/types/inline_query_result_cached_voice.py b/aiogram/types/inline_query_result_cached_voice.py similarity index 100% rename from aiogram/api/types/inline_query_result_cached_voice.py rename to aiogram/types/inline_query_result_cached_voice.py diff --git a/aiogram/api/types/inline_query_result_contact.py b/aiogram/types/inline_query_result_contact.py similarity index 100% rename from aiogram/api/types/inline_query_result_contact.py rename to aiogram/types/inline_query_result_contact.py diff --git a/aiogram/api/types/inline_query_result_document.py b/aiogram/types/inline_query_result_document.py similarity index 100% rename from aiogram/api/types/inline_query_result_document.py rename to aiogram/types/inline_query_result_document.py diff --git a/aiogram/api/types/inline_query_result_game.py b/aiogram/types/inline_query_result_game.py similarity index 100% rename from aiogram/api/types/inline_query_result_game.py rename to aiogram/types/inline_query_result_game.py diff --git a/aiogram/api/types/inline_query_result_gif.py b/aiogram/types/inline_query_result_gif.py similarity index 100% rename from aiogram/api/types/inline_query_result_gif.py rename to aiogram/types/inline_query_result_gif.py diff --git a/aiogram/api/types/inline_query_result_location.py b/aiogram/types/inline_query_result_location.py similarity index 100% rename from aiogram/api/types/inline_query_result_location.py rename to aiogram/types/inline_query_result_location.py diff --git a/aiogram/api/types/inline_query_result_mpeg4_gif.py b/aiogram/types/inline_query_result_mpeg4_gif.py similarity index 100% rename from aiogram/api/types/inline_query_result_mpeg4_gif.py rename to aiogram/types/inline_query_result_mpeg4_gif.py diff --git a/aiogram/api/types/inline_query_result_photo.py b/aiogram/types/inline_query_result_photo.py similarity index 100% rename from aiogram/api/types/inline_query_result_photo.py rename to aiogram/types/inline_query_result_photo.py diff --git a/aiogram/api/types/inline_query_result_venue.py b/aiogram/types/inline_query_result_venue.py similarity index 100% rename from aiogram/api/types/inline_query_result_venue.py rename to aiogram/types/inline_query_result_venue.py diff --git a/aiogram/api/types/inline_query_result_video.py b/aiogram/types/inline_query_result_video.py similarity index 100% rename from aiogram/api/types/inline_query_result_video.py rename to aiogram/types/inline_query_result_video.py diff --git a/aiogram/api/types/inline_query_result_voice.py b/aiogram/types/inline_query_result_voice.py similarity index 100% rename from aiogram/api/types/inline_query_result_voice.py rename to aiogram/types/inline_query_result_voice.py diff --git a/aiogram/api/types/input_contact_message_content.py b/aiogram/types/input_contact_message_content.py similarity index 100% rename from aiogram/api/types/input_contact_message_content.py rename to aiogram/types/input_contact_message_content.py diff --git a/aiogram/api/types/input_file.py b/aiogram/types/input_file.py similarity index 98% rename from aiogram/api/types/input_file.py rename to aiogram/types/input_file.py index 86d7c62a..1407870a 100644 --- a/aiogram/api/types/input_file.py +++ b/aiogram/types/input_file.py @@ -98,7 +98,7 @@ class URLInputFile(InputFile): self.timeout = timeout async def read(self, chunk_size: int) -> AsyncGenerator[bytes, None]: - from aiogram.api.client.bot import Bot + from aiogram.client.bot import Bot bot = Bot.get_current(no_error=False) stream = bot.session.stream_content( diff --git a/aiogram/api/types/input_location_message_content.py b/aiogram/types/input_location_message_content.py similarity index 100% rename from aiogram/api/types/input_location_message_content.py rename to aiogram/types/input_location_message_content.py diff --git a/aiogram/api/types/input_media.py b/aiogram/types/input_media.py similarity index 100% rename from aiogram/api/types/input_media.py rename to aiogram/types/input_media.py diff --git a/aiogram/api/types/input_media_animation.py b/aiogram/types/input_media_animation.py similarity index 100% rename from aiogram/api/types/input_media_animation.py rename to aiogram/types/input_media_animation.py diff --git a/aiogram/api/types/input_media_audio.py b/aiogram/types/input_media_audio.py similarity index 100% rename from aiogram/api/types/input_media_audio.py rename to aiogram/types/input_media_audio.py diff --git a/aiogram/api/types/input_media_document.py b/aiogram/types/input_media_document.py similarity index 100% rename from aiogram/api/types/input_media_document.py rename to aiogram/types/input_media_document.py diff --git a/aiogram/api/types/input_media_photo.py b/aiogram/types/input_media_photo.py similarity index 100% rename from aiogram/api/types/input_media_photo.py rename to aiogram/types/input_media_photo.py diff --git a/aiogram/api/types/input_media_video.py b/aiogram/types/input_media_video.py similarity index 100% rename from aiogram/api/types/input_media_video.py rename to aiogram/types/input_media_video.py diff --git a/aiogram/api/types/input_message_content.py b/aiogram/types/input_message_content.py similarity index 100% rename from aiogram/api/types/input_message_content.py rename to aiogram/types/input_message_content.py diff --git a/aiogram/api/types/input_text_message_content.py b/aiogram/types/input_text_message_content.py similarity index 100% rename from aiogram/api/types/input_text_message_content.py rename to aiogram/types/input_text_message_content.py diff --git a/aiogram/api/types/input_venue_message_content.py b/aiogram/types/input_venue_message_content.py similarity index 100% rename from aiogram/api/types/input_venue_message_content.py rename to aiogram/types/input_venue_message_content.py diff --git a/aiogram/api/types/invoice.py b/aiogram/types/invoice.py similarity index 100% rename from aiogram/api/types/invoice.py rename to aiogram/types/invoice.py diff --git a/aiogram/api/types/keyboard_button.py b/aiogram/types/keyboard_button.py similarity index 100% rename from aiogram/api/types/keyboard_button.py rename to aiogram/types/keyboard_button.py diff --git a/aiogram/api/types/keyboard_button_poll_type.py b/aiogram/types/keyboard_button_poll_type.py similarity index 100% rename from aiogram/api/types/keyboard_button_poll_type.py rename to aiogram/types/keyboard_button_poll_type.py diff --git a/aiogram/api/types/labeled_price.py b/aiogram/types/labeled_price.py similarity index 100% rename from aiogram/api/types/labeled_price.py rename to aiogram/types/labeled_price.py diff --git a/aiogram/api/types/location.py b/aiogram/types/location.py similarity index 100% rename from aiogram/api/types/location.py rename to aiogram/types/location.py diff --git a/aiogram/api/types/login_url.py b/aiogram/types/login_url.py similarity index 100% rename from aiogram/api/types/login_url.py rename to aiogram/types/login_url.py diff --git a/aiogram/api/types/mask_position.py b/aiogram/types/mask_position.py similarity index 100% rename from aiogram/api/types/mask_position.py rename to aiogram/types/mask_position.py diff --git a/aiogram/api/types/message.py b/aiogram/types/message.py similarity index 99% rename from aiogram/api/types/message.py rename to aiogram/types/message.py index 590b3a04..4d611456 100644 --- a/aiogram/api/types/message.py +++ b/aiogram/types/message.py @@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, List, Optional, Union from pydantic import Field -from ...utils import helper +from aiogram.utils import helper from .base import UNSET, TelegramObject if TYPE_CHECKING: # pragma: no cover diff --git a/aiogram/api/types/message_entity.py b/aiogram/types/message_entity.py similarity index 92% rename from aiogram/api/types/message_entity.py rename to aiogram/types/message_entity.py index 54c11a46..ae52d59c 100644 --- a/aiogram/api/types/message_entity.py +++ b/aiogram/types/message_entity.py @@ -2,13 +2,13 @@ from __future__ import annotations from typing import TYPE_CHECKING, Optional -from .base import TelegramObject +from .base import MutableTelegramObject, TelegramObject if TYPE_CHECKING: # pragma: no cover from .user import User -class MessageEntity(TelegramObject): +class MessageEntity(MutableTelegramObject): """ This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. diff --git a/aiogram/api/types/message_id.py b/aiogram/types/message_id.py similarity index 100% rename from aiogram/api/types/message_id.py rename to aiogram/types/message_id.py diff --git a/aiogram/api/types/order_info.py b/aiogram/types/order_info.py similarity index 100% rename from aiogram/api/types/order_info.py rename to aiogram/types/order_info.py diff --git a/aiogram/api/types/passport_data.py b/aiogram/types/passport_data.py similarity index 100% rename from aiogram/api/types/passport_data.py rename to aiogram/types/passport_data.py diff --git a/aiogram/api/types/passport_element_error.py b/aiogram/types/passport_element_error.py similarity index 100% rename from aiogram/api/types/passport_element_error.py rename to aiogram/types/passport_element_error.py diff --git a/aiogram/api/types/passport_element_error_data_field.py b/aiogram/types/passport_element_error_data_field.py similarity index 100% rename from aiogram/api/types/passport_element_error_data_field.py rename to aiogram/types/passport_element_error_data_field.py diff --git a/aiogram/api/types/passport_element_error_file.py b/aiogram/types/passport_element_error_file.py similarity index 100% rename from aiogram/api/types/passport_element_error_file.py rename to aiogram/types/passport_element_error_file.py diff --git a/aiogram/api/types/passport_element_error_files.py b/aiogram/types/passport_element_error_files.py similarity index 100% rename from aiogram/api/types/passport_element_error_files.py rename to aiogram/types/passport_element_error_files.py diff --git a/aiogram/api/types/passport_element_error_front_side.py b/aiogram/types/passport_element_error_front_side.py similarity index 100% rename from aiogram/api/types/passport_element_error_front_side.py rename to aiogram/types/passport_element_error_front_side.py diff --git a/aiogram/api/types/passport_element_error_reverse_side.py b/aiogram/types/passport_element_error_reverse_side.py similarity index 100% rename from aiogram/api/types/passport_element_error_reverse_side.py rename to aiogram/types/passport_element_error_reverse_side.py diff --git a/aiogram/api/types/passport_element_error_selfie.py b/aiogram/types/passport_element_error_selfie.py similarity index 100% rename from aiogram/api/types/passport_element_error_selfie.py rename to aiogram/types/passport_element_error_selfie.py diff --git a/aiogram/api/types/passport_element_error_translation_file.py b/aiogram/types/passport_element_error_translation_file.py similarity index 100% rename from aiogram/api/types/passport_element_error_translation_file.py rename to aiogram/types/passport_element_error_translation_file.py diff --git a/aiogram/api/types/passport_element_error_translation_files.py b/aiogram/types/passport_element_error_translation_files.py similarity index 100% rename from aiogram/api/types/passport_element_error_translation_files.py rename to aiogram/types/passport_element_error_translation_files.py diff --git a/aiogram/api/types/passport_element_error_unspecified.py b/aiogram/types/passport_element_error_unspecified.py similarity index 100% rename from aiogram/api/types/passport_element_error_unspecified.py rename to aiogram/types/passport_element_error_unspecified.py diff --git a/aiogram/api/types/passport_file.py b/aiogram/types/passport_file.py similarity index 100% rename from aiogram/api/types/passport_file.py rename to aiogram/types/passport_file.py diff --git a/aiogram/api/types/photo_size.py b/aiogram/types/photo_size.py similarity index 100% rename from aiogram/api/types/photo_size.py rename to aiogram/types/photo_size.py diff --git a/aiogram/api/types/poll.py b/aiogram/types/poll.py similarity index 100% rename from aiogram/api/types/poll.py rename to aiogram/types/poll.py diff --git a/aiogram/api/types/poll_answer.py b/aiogram/types/poll_answer.py similarity index 100% rename from aiogram/api/types/poll_answer.py rename to aiogram/types/poll_answer.py diff --git a/aiogram/api/types/poll_option.py b/aiogram/types/poll_option.py similarity index 100% rename from aiogram/api/types/poll_option.py rename to aiogram/types/poll_option.py diff --git a/aiogram/api/types/pre_checkout_query.py b/aiogram/types/pre_checkout_query.py similarity index 100% rename from aiogram/api/types/pre_checkout_query.py rename to aiogram/types/pre_checkout_query.py diff --git a/aiogram/api/types/proximity_alert_triggered.py b/aiogram/types/proximity_alert_triggered.py similarity index 100% rename from aiogram/api/types/proximity_alert_triggered.py rename to aiogram/types/proximity_alert_triggered.py diff --git a/aiogram/api/types/reply_keyboard_markup.py b/aiogram/types/reply_keyboard_markup.py similarity index 100% rename from aiogram/api/types/reply_keyboard_markup.py rename to aiogram/types/reply_keyboard_markup.py diff --git a/aiogram/api/types/reply_keyboard_remove.py b/aiogram/types/reply_keyboard_remove.py similarity index 100% rename from aiogram/api/types/reply_keyboard_remove.py rename to aiogram/types/reply_keyboard_remove.py diff --git a/aiogram/api/types/response_parameters.py b/aiogram/types/response_parameters.py similarity index 100% rename from aiogram/api/types/response_parameters.py rename to aiogram/types/response_parameters.py diff --git a/aiogram/api/types/shipping_address.py b/aiogram/types/shipping_address.py similarity index 100% rename from aiogram/api/types/shipping_address.py rename to aiogram/types/shipping_address.py diff --git a/aiogram/api/types/shipping_option.py b/aiogram/types/shipping_option.py similarity index 100% rename from aiogram/api/types/shipping_option.py rename to aiogram/types/shipping_option.py diff --git a/aiogram/api/types/shipping_query.py b/aiogram/types/shipping_query.py similarity index 100% rename from aiogram/api/types/shipping_query.py rename to aiogram/types/shipping_query.py diff --git a/aiogram/api/types/sticker.py b/aiogram/types/sticker.py similarity index 100% rename from aiogram/api/types/sticker.py rename to aiogram/types/sticker.py diff --git a/aiogram/api/types/sticker_set.py b/aiogram/types/sticker_set.py similarity index 100% rename from aiogram/api/types/sticker_set.py rename to aiogram/types/sticker_set.py diff --git a/aiogram/api/types/successful_payment.py b/aiogram/types/successful_payment.py similarity index 100% rename from aiogram/api/types/successful_payment.py rename to aiogram/types/successful_payment.py diff --git a/aiogram/api/types/update.py b/aiogram/types/update.py similarity index 100% rename from aiogram/api/types/update.py rename to aiogram/types/update.py diff --git a/aiogram/api/types/user.py b/aiogram/types/user.py similarity index 100% rename from aiogram/api/types/user.py rename to aiogram/types/user.py diff --git a/aiogram/api/types/user_profile_photos.py b/aiogram/types/user_profile_photos.py similarity index 100% rename from aiogram/api/types/user_profile_photos.py rename to aiogram/types/user_profile_photos.py diff --git a/aiogram/api/types/venue.py b/aiogram/types/venue.py similarity index 100% rename from aiogram/api/types/venue.py rename to aiogram/types/venue.py diff --git a/aiogram/api/types/video.py b/aiogram/types/video.py similarity index 100% rename from aiogram/api/types/video.py rename to aiogram/types/video.py diff --git a/aiogram/api/types/video_note.py b/aiogram/types/video_note.py similarity index 100% rename from aiogram/api/types/video_note.py rename to aiogram/types/video_note.py diff --git a/aiogram/api/types/voice.py b/aiogram/types/voice.py similarity index 100% rename from aiogram/api/types/voice.py rename to aiogram/types/voice.py diff --git a/aiogram/api/types/webhook_info.py b/aiogram/types/webhook_info.py similarity index 100% rename from aiogram/api/types/webhook_info.py rename to aiogram/types/webhook_info.py diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index ac5262c1..db074975 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -6,7 +6,7 @@ from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Generator, List, Optional, Pattern, cast if TYPE_CHECKING: # pragma: no cover - from aiogram.api.types import MessageEntity + from aiogram.types import MessageEntity __all__ = ( "TextDecoration", @@ -38,7 +38,7 @@ class TextDecoration(ABC): else self.pre(value=text) ) if entity.type == "text_mention": - from aiogram.api.types import User + from aiogram.types import User user = cast(User, entity.user) return self.link(value=text, link=f"tg://user?id={user.id}") diff --git a/docs/api/client/session/aiohttp.md b/docs/api/client/session/aiohttp.md index 223ad468..dd49eef8 100644 --- a/docs/api/client/session/aiohttp.md +++ b/docs/api/client/session/aiohttp.md @@ -8,7 +8,7 @@ Currently `AiohttpSession` is a default session used in `aiogram.Bot` ```python from aiogram import Bot -from aiogram.api.client.session.aiohttp import AiohttpSession +from aiogram.client.session.aiohttp import AiohttpSession session = AiohttpSession() Bot('token', session=session) @@ -20,9 +20,10 @@ Bot('token', session=session) In order to use AiohttpSession with proxy connector you have to install [aiohttp-socks](https://pypi.org/project/aiohttp-socks/ "PyPi repository"){target=_blank} Binding session to bot: + ```python from aiogram import Bot -from aiogram.api.client.session.aiohttp import AiohttpSession +from aiogram.client.session.aiohttp import AiohttpSession session = AiohttpSession(proxy="protocol://host:port/") Bot(token="bot token", session=session) @@ -38,9 +39,10 @@ Proxy authorization credentials can be specified in proxy URL or come as an inst login and password. Consider examples: + ```python -from aiohttp import BasicAuth -from aiogram.api.client.session.aiohttp import AiohttpSession +from aiogram.client.session.aiohttp import BasicAuth +from aiogram.client.session.aiohttp import AiohttpSession auth = BasicAuth(login="user", password="password") session = AiohttpSession(proxy=("protocol://host:port", auth)) @@ -59,15 +61,16 @@ session = AiohttpSession(proxy="protocol://user:password@host:port") Since [aiohttp-socks]('https://pypi.org/project/aiohttp-socks/') supports proxy chains, you're able to use them in aiogram Example of chain proxies: + ```python -from aiohttp import BasicAuth -from aiogram.api.client.session.aiohttp import AiohttpSession +from aiogram.client.session.aiohttp import BasicAuth +from aiogram.client.session.aiohttp import AiohttpSession auth = BasicAuth(login="user", password="password") session = AiohttpSession( proxy={"protocol0://host0:port0", "protocol1://user:password@host1:port1", - ("protocol2://host2:port2", auth),} # can be any iterable if not set + ("protocol2://host2:port2", auth), } # can be any iterable if not set ) ``` diff --git a/poetry.lock b/poetry.lock index d81c8b2f..d519761f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -36,6 +36,14 @@ version = "0.3.9" aiohttp = ">=2.3.2" attrs = ">=19.2.0" +[[package]] +category = "dev" +description = "A configurable sidebar-enabled Sphinx theme" +name = "alabaster" +optional = false +python-versions = "*" +version = "0.7.12" + [[package]] category = "dev" description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." @@ -132,6 +140,23 @@ optional = false python-versions = "*" version = "0.2.0" +[[package]] +category = "dev" +description = "Screen-scraping library" +name = "beautifulsoup4" +optional = false +python-versions = "*" +version = "4.9.3" + +[package.dependencies] +[package.dependencies.soupsieve] +python = ">=3.0" +version = ">1.2" + +[package.extras] +html5lib = ["html5lib"] +lxml = ["lxml"] + [[package]] category = "dev" description = "The uncompromising code formatter." @@ -308,6 +333,14 @@ optional = false python-versions = "*" version = "0.3.0" +[[package]] +category = "dev" +description = "Docutils -- Python Documentation Utilities" +name = "docutils" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "0.16" + [[package]] category = "dev" description = "A platform independent file lock." @@ -347,6 +380,22 @@ importlib-metadata = "*" jinja2 = ">=2.9.0" pygments = ">=2.2.0" +[[package]] +category = "dev" +description = "A clean customisable Sphinx documentation theme." +name = "furo" +optional = false +python-versions = ">=3.5" +version = "2020.11.15b17" + +[package.dependencies] +beautifulsoup4 = "*" +sphinx = ">3.0" + +[package.extras] +doc = ["myst-parser", "sphinx-inline-tabs"] +test = ["pytest", "pytest-cov", "pytest-xdist"] + [[package]] category = "dev" description = "Clean single-source support for Python 3 and 2" @@ -393,6 +442,14 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "2.9" +[[package]] +category = "dev" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +name = "imagesize" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.2.0" + [[package]] category = "dev" description = "Read metadata from Python packages" @@ -1246,6 +1303,126 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" version = "1.15.0" +[[package]] +category = "dev" +description = "This package provides 26 stemmers for 25 languages generated from Snowball algorithms." +name = "snowballstemmer" +optional = false +python-versions = "*" +version = "2.0.0" + +[[package]] +category = "dev" +description = "A modern CSS selector implementation for Beautiful Soup." +marker = "python_version >= \"3.0\"" +name = "soupsieve" +optional = false +python-versions = ">=3.5" +version = "2.0.1" + +[[package]] +category = "dev" +description = "Python documentation generator" +name = "sphinx" +optional = false +python-versions = ">=3.5" +version = "3.3.1" + +[package.dependencies] +Jinja2 = ">=2.3" +Pygments = ">=2.0" +alabaster = ">=0.7,<0.8" +babel = ">=1.3" +colorama = ">=0.3.5" +docutils = ">=0.12" +imagesize = "*" +packaging = "*" +requests = ">=2.5.0" +setuptools = "*" +snowballstemmer = ">=1.1" +sphinxcontrib-applehelp = "*" +sphinxcontrib-devhelp = "*" +sphinxcontrib-htmlhelp = "*" +sphinxcontrib-jsmath = "*" +sphinxcontrib-qthelp = "*" +sphinxcontrib-serializinghtml = "*" + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["flake8 (>=3.5.0)", "flake8-import-order", "mypy (>=0.790)", "docutils-stubs"] +test = ["pytest", "pytest-cov", "html5lib", "typed-ast", "cython"] + +[[package]] +category = "dev" +description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" +name = "sphinxcontrib-applehelp" +optional = false +python-versions = ">=3.5" +version = "1.0.2" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + +[[package]] +category = "dev" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." +name = "sphinxcontrib-devhelp" +optional = false +python-versions = ">=3.5" +version = "1.0.2" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + +[[package]] +category = "dev" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +name = "sphinxcontrib-htmlhelp" +optional = false +python-versions = ">=3.5" +version = "1.0.3" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest", "html5lib"] + +[[package]] +category = "dev" +description = "A sphinx extension which renders display math in HTML via JavaScript" +name = "sphinxcontrib-jsmath" +optional = false +python-versions = ">=3.5" +version = "1.0.1" + +[package.extras] +test = ["pytest", "flake8", "mypy"] + +[[package]] +category = "dev" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." +name = "sphinxcontrib-qthelp" +optional = false +python-versions = ">=3.5" +version = "1.0.3" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + +[[package]] +category = "dev" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." +name = "sphinxcontrib-serializinghtml" +optional = false +python-versions = ">=3.5" +version = "1.1.4" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + [[package]] category = "dev" description = "Python Library for Tom's Obvious, Minimal Language" @@ -1403,7 +1580,7 @@ fast = ["uvloop"] proxy = ["aiohttp-socks"] [metadata] -content-hash = "152bb9b155a00baadd3c8b9fa21f08af719180bddccb8ad6c3dd6548c3e71e3e" +content-hash = "80408d8f77e71b544fdcc1d00472e5afd33edf8e4de03516bd5aa9962cf8a68a" python-versions = "^3.7" [metadata.files] @@ -1429,6 +1606,10 @@ aiohttp-socks = [ {file = "aiohttp_socks-0.3.9-py3-none-any.whl", hash = "sha256:ccd483d7677d7ba80b7ccb738a9be27a3ad6dce4b2756509bc71c9d679d96105"}, {file = "aiohttp_socks-0.3.9.tar.gz", hash = "sha256:5e5638d0e472baa441eab7990cf19e034960cc803f259748cc359464ccb3c2d6"}, ] +alabaster = [ + {file = "alabaster-0.7.12-py2.py3-none-any.whl", hash = "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359"}, + {file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"}, +] appdirs = [ {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, @@ -1468,6 +1649,11 @@ backcall = [ {file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"}, {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, ] +beautifulsoup4 = [ + {file = "beautifulsoup4-4.9.3-py2-none-any.whl", hash = "sha256:4c98143716ef1cb40bf7f39a8e3eec8f8b009509e74904ba3a7b315431577e35"}, + {file = "beautifulsoup4-4.9.3-py3-none-any.whl", hash = "sha256:fff47e031e34ec82bf17e00da8f592fe7de69aeea38be00523c04623c04fb666"}, + {file = "beautifulsoup4-4.9.3.tar.gz", hash = "sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25"}, +] black = [ {file = "black-19.10b0-py36-none-any.whl", hash = "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b"}, {file = "black-19.10b0.tar.gz", hash = "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539"}, @@ -1599,6 +1785,10 @@ decorator = [ distlib = [ {file = "distlib-0.3.0.zip", hash = "sha256:2e166e231a26b36d6dfe35a48c4464346620f8645ed0ace01ee31822b288de21"}, ] +docutils = [ + {file = "docutils-0.16-py2.py3-none-any.whl", hash = "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af"}, + {file = "docutils-0.16.tar.gz", hash = "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"}, +] filelock = [ {file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"}, {file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"}, @@ -1611,6 +1801,10 @@ flake8-html = [ {file = "flake8-html-0.4.1.tar.gz", hash = "sha256:2fb436cbfe1e109275bc8fb7fdd0cb00e67b3b48cfeb397309b6b2c61eeb4cb4"}, {file = "flake8_html-0.4.1-py2.py3-none-any.whl", hash = "sha256:17324eb947e7006807e4184ee26953e67baf421b3cf9e646a38bfec34eec5a94"}, ] +furo = [ + {file = "furo-2020.11.15b17-py3-none-any.whl", hash = "sha256:0186e01b9be564679f15d8fda313baff633ae11d5bd28147ac8e4668eb143d62"}, + {file = "furo-2020.11.15b17.tar.gz", hash = "sha256:f34cb10ca26967b03e7511349974d720bc49709835b022944ca6c881221f1f2c"}, +] future = [ {file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"}, ] @@ -1626,6 +1820,10 @@ idna = [ {file = "idna-2.9-py2.py3-none-any.whl", hash = "sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa"}, {file = "idna-2.9.tar.gz", hash = "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb"}, ] +imagesize = [ + {file = "imagesize-1.2.0-py2.py3-none-any.whl", hash = "sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1"}, + {file = "imagesize-1.2.0.tar.gz", hash = "sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1"}, +] importlib-metadata = [ {file = "importlib_metadata-1.1.3-py2.py3-none-any.whl", hash = "sha256:7c7f8ac40673f507f349bef2eed21a0e5f01ddf5b2a7356a6c65eb2099b53764"}, {file = "importlib_metadata-1.1.3.tar.gz", hash = "sha256:7a99fb4084ffe6dae374961ba7a6521b79c1d07c658ab3a28aa264ee1d1b14e3"}, @@ -2023,6 +2221,42 @@ six = [ {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, ] +snowballstemmer = [ + {file = "snowballstemmer-2.0.0-py2.py3-none-any.whl", hash = "sha256:209f257d7533fdb3cb73bdbd24f436239ca3b2fa67d56f6ff88e86be08cc5ef0"}, + {file = "snowballstemmer-2.0.0.tar.gz", hash = "sha256:df3bac3df4c2c01363f3dd2cfa78cce2840a79b9f1c2d2de9ce8d31683992f52"}, +] +soupsieve = [ + {file = "soupsieve-2.0.1-py3-none-any.whl", hash = "sha256:1634eea42ab371d3d346309b93df7870a88610f0725d47528be902a0d95ecc55"}, + {file = "soupsieve-2.0.1.tar.gz", hash = "sha256:a59dc181727e95d25f781f0eb4fd1825ff45590ec8ff49eadfd7f1a537cc0232"}, +] +sphinx = [ + {file = "Sphinx-3.3.1-py3-none-any.whl", hash = "sha256:d4e59ad4ea55efbb3c05cde3bfc83bfc14f0c95aa95c3d75346fcce186a47960"}, + {file = "Sphinx-3.3.1.tar.gz", hash = "sha256:1e8d592225447104d1172be415bc2972bd1357e3e12fdc76edf2261105db4300"}, +] +sphinxcontrib-applehelp = [ + {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, + {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, +] +sphinxcontrib-devhelp = [ + {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, + {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, +] +sphinxcontrib-htmlhelp = [ + {file = "sphinxcontrib-htmlhelp-1.0.3.tar.gz", hash = "sha256:e8f5bb7e31b2dbb25b9cc435c8ab7a79787ebf7f906155729338f3156d93659b"}, + {file = "sphinxcontrib_htmlhelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:3c0bc24a2c41e340ac37c85ced6dafc879ab485c095b1d65d2461ac2f7cca86f"}, +] +sphinxcontrib-jsmath = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] +sphinxcontrib-qthelp = [ + {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, + {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, +] +sphinxcontrib-serializinghtml = [ + {file = "sphinxcontrib-serializinghtml-1.1.4.tar.gz", hash = "sha256:eaa0eccc86e982a9b939b2b82d12cc5d013385ba5eadcc7e4fed23f4405f77bc"}, + {file = "sphinxcontrib_serializinghtml-1.1.4-py2.py3-none-any.whl", hash = "sha256:f242a81d423f59617a8e5cf16f5d4d74e28ee9a66f9e5b637a18082991db5a9a"}, +] toml = [ {file = "toml-0.10.1-py2.py3-none-any.whl", hash = "sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88"}, {file = "toml-0.10.1.tar.gz", hash = "sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f"}, diff --git a/pyproject.toml b/pyproject.toml index 22efdce3..98af5650 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "aiogram" -version = "3.0.0-alpha.5" +version = "3.0.0-alpha.6" description = "Modern and fully asynchronous framework for Telegram Bot API" authors = ["Alex Root Junior "] license = "MIT" @@ -69,6 +69,7 @@ pre-commit = "^2.3.0" packaging = "^20.3" typing-extensions = "^3.7.4" poetry = "^1.0.5" +furo = "^2020.11.15-beta.17" [tool.poetry.extras] fast = ["uvloop"] diff --git a/tests/mocked_bot.py b/tests/mocked_bot.py index f0b1ead6..d83d5a86 100644 --- a/tests/mocked_bot.py +++ b/tests/mocked_bot.py @@ -2,7 +2,7 @@ from collections import deque from typing import TYPE_CHECKING, AsyncGenerator, Deque, Optional, Type from aiogram import Bot -from aiogram.api.client.session.base import BaseSession +from aiogram.client.session.base import BaseSession from aiogram.api.methods import TelegramMethod from aiogram.api.methods.base import Request, Response, T from aiogram.api.types import UNSET diff --git a/tests/test_api/test_client/test_bot.py b/tests/test_api/test_client/test_bot.py index b9dff9e7..ba7dccb9 100644 --- a/tests/test_api/test_client/test_bot.py +++ b/tests/test_api/test_client/test_bot.py @@ -5,7 +5,7 @@ import pytest from aresponses import ResponsesMockServer from aiogram import Bot -from aiogram.api.client.session.aiohttp import AiohttpSession +from aiogram.client.session.aiohttp import AiohttpSession from aiogram.api.methods import GetFile, GetMe from aiogram.api.types import File, PhotoSize from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_client/test_session/test_aiohttp_session.py b/tests/test_api/test_client/test_session/test_aiohttp_session.py index bb89e888..c7951a1d 100644 --- a/tests/test_api/test_client/test_session/test_aiohttp_session.py +++ b/tests/test_api/test_client/test_session/test_aiohttp_session.py @@ -1,12 +1,12 @@ from typing import AsyncContextManager, AsyncGenerator -import aiohttp +from aiogram.client.session import aiohttp import aiohttp_socks import pytest from aresponses import ResponsesMockServer from aiogram import Bot -from aiogram.api.client.session.aiohttp import AiohttpSession +from aiogram.client.session.aiohttp import AiohttpSession from aiogram.api.methods import Request, TelegramMethod from aiogram.api.types import InputFile from tests.mocked_bot import MockedBot diff --git a/tests/test_api/test_client/test_session/test_base_session.py b/tests/test_api/test_client/test_session/test_base_session.py index 42dfedf7..46c1b3f3 100644 --- a/tests/test_api/test_client/test_session/test_base_session.py +++ b/tests/test_api/test_client/test_session/test_base_session.py @@ -4,7 +4,7 @@ from typing import AsyncContextManager, AsyncGenerator, Optional import pytest -from aiogram.api.client.session.base import BaseSession, T +from aiogram.client.session.base import BaseSession, T from aiogram.api.client.telegram import PRODUCTION, TelegramAPIServer from aiogram.api.methods import GetMe, Response, TelegramMethod from aiogram.api.types import UNSET diff --git a/tests/test_api/test_types/test_message.py b/tests/test_api/test_types/test_message.py index f386e191..eec008d0 100644 --- a/tests/test_api/test_types/test_message.py +++ b/tests/test_api/test_types/test_message.py @@ -45,7 +45,7 @@ from aiogram.api.types import ( VideoNote, Voice, ) -from aiogram.api.types.message import ContentType, Message +from aiogram.types.message import ContentType, Message class TestMessage: