mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Refactor imports and clean up redundant code across methods, types, and webhook server classes
This commit is contained in:
parent
5066e5e82f
commit
672ddb0d69
7 changed files with 9 additions and 18 deletions
|
|
@ -58,13 +58,13 @@ from ..methods import (
|
|||
EditForumTopic,
|
||||
EditGeneralForumTopic,
|
||||
EditMessageCaption,
|
||||
EditMessageChecklist,
|
||||
EditMessageLiveLocation,
|
||||
EditMessageMedia,
|
||||
EditMessageReplyMarkup,
|
||||
EditMessageText,
|
||||
EditStory,
|
||||
EditUserStarSubscription,
|
||||
EditMessageChecklist,
|
||||
ExportChatInviteLink,
|
||||
ForwardMessage,
|
||||
ForwardMessages,
|
||||
|
|
@ -201,8 +201,8 @@ from ..types import (
|
|||
InlineKeyboardMarkup,
|
||||
InlineQueryResultsButton,
|
||||
InlineQueryResultUnion,
|
||||
InputFile,
|
||||
InputChecklist,
|
||||
InputFile,
|
||||
InputFileUnion,
|
||||
InputMediaUnion,
|
||||
InputPaidMediaUnion,
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ from .delete_story import DeleteStory
|
|||
from .delete_webhook import DeleteWebhook
|
||||
from .edit_chat_invite_link import EditChatInviteLink
|
||||
from .edit_chat_subscription_invite_link import EditChatSubscriptionInviteLink
|
||||
from .edit_message_checklist import EditMessageChecklist
|
||||
from .edit_forum_topic import EditForumTopic
|
||||
from .edit_general_forum_topic import EditGeneralForumTopic
|
||||
from .edit_message_caption import EditMessageCaption
|
||||
from .edit_message_checklist import EditMessageChecklist
|
||||
from .edit_message_live_location import EditMessageLiveLocation
|
||||
from .edit_message_media import EditMessageMedia
|
||||
from .edit_message_reply_markup import EditMessageReplyMarkup
|
||||
|
|
|
|||
|
|
@ -2,11 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from ..types import (
|
||||
InlineKeyboardMarkup,
|
||||
InputChecklist,
|
||||
Message,
|
||||
)
|
||||
from ..types import InlineKeyboardMarkup, InputChecklist, Message
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from ..types import (
|
||||
InlineKeyboardMarkup,
|
||||
InputChecklist,
|
||||
Message,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types import InlineKeyboardMarkup, InputChecklist, Message, ReplyParameters
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING, Any, Literal, Optional
|
||||
|
||||
from aiogram.enums import OwnedGiftType
|
||||
from .custom import DateTime
|
||||
|
||||
from .custom import DateTime
|
||||
from .owned_gift import OwnedGift
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .custom import DateTime
|
||||
from .base import TelegramObject
|
||||
from .custom import DateTime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .unique_gift import UniqueGift
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ from asyncio import Transport
|
|||
from typing import Any, Awaitable, Callable, Dict, Optional, Set, Tuple, cast
|
||||
|
||||
from aiohttp import JsonPayload, MultipartWriter, Payload, web
|
||||
from aiohttp.web_app import Application
|
||||
from aiohttp.typedefs import Handler
|
||||
from aiohttp.web_app import Application
|
||||
from aiohttp.web_middlewares import middleware
|
||||
|
||||
from aiogram import Bot, Dispatcher, loggers
|
||||
|
|
@ -111,7 +111,7 @@ class BaseRequestHandler(ABC):
|
|||
app.on_shutdown.append(self._handle_close)
|
||||
app.router.add_route("POST", path, self.handle, **kwargs)
|
||||
|
||||
async def _handle_close(self, app: Application) -> None:
|
||||
async def _handle_close(self, *a: Any, **kw: Any) -> None:
|
||||
await self.close()
|
||||
|
||||
@abstractmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue