From d77efe3513ad15eb476206836691749fc8d4b1b5 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 17 Mar 2024 13:10:50 +0100 Subject: [PATCH] Rename chat folder to peer --- .../telethon/_impl/client/events/queries.py | 2 +- .../telethon/_impl/client/types/__init__.py | 20 +++++++++---------- .../_impl/client/types/album_builder.py | 2 +- .../src/telethon/_impl/client/types/dialog.py | 2 +- .../src/telethon/_impl/client/types/draft.py | 2 +- .../_impl/client/types/inline_result.py | 2 +- .../telethon/_impl/client/types/message.py | 2 +- .../_impl/client/types/participant.py | 2 +- .../client/types/{chat => peer}/__init__.py | 0 .../client/types/{chat => peer}/channel.py | 0 .../_impl/client/types/{chat => peer}/chat.py | 0 .../client/types/{chat => peer}/group.py | 0 .../_impl/client/types/{chat => peer}/user.py | 0 .../_impl/client/types/recent_action.py | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) rename client/src/telethon/_impl/client/types/{chat => peer}/__init__.py (100%) rename client/src/telethon/_impl/client/types/{chat => peer}/channel.py (100%) rename client/src/telethon/_impl/client/types/{chat => peer}/chat.py (100%) rename client/src/telethon/_impl/client/types/{chat => peer}/group.py (100%) rename client/src/telethon/_impl/client/types/{chat => peer}/user.py (100%) diff --git a/client/src/telethon/_impl/client/events/queries.py b/client/src/telethon/_impl/client/events/queries.py index 20a1511c..028404ab 100644 --- a/client/src/telethon/_impl/client/events/queries.py +++ b/client/src/telethon/_impl/client/events/queries.py @@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Optional, Self from ...tl import abcs, functions, types from ..client.messages import CherryPickedList from ..types import Chat, Message -from ..types.chat import peer_id +from ..types.peer import peer_id from .event import Event if TYPE_CHECKING: diff --git a/client/src/telethon/_impl/client/types/__init__.py b/client/src/telethon/_impl/client/types/__init__.py index 72beb9d9..459bff26 100644 --- a/client/src/telethon/_impl/client/types/__init__.py +++ b/client/src/telethon/_impl/client/types/__init__.py @@ -2,16 +2,6 @@ from .admin_right import AdminRight from .album_builder import AlbumBuilder from .async_list import AsyncList from .callback_answer import CallbackAnswer -from .chat import ( - Channel, - Chat, - ChatLike, - Group, - User, - build_chat_map, - expand_peer, - peer_id, -) from .chat_restriction import ChatRestriction from .dialog import Dialog from .draft import Draft @@ -35,6 +25,16 @@ from .message import ( from .meta import NoPublicConstructor from .participant import Participant from .password_token import PasswordToken +from .peer import ( + Channel, + Chat, + ChatLike, + Group, + User, + build_chat_map, + expand_peer, + peer_id, +) from .recent_action import RecentAction __all__ = [ diff --git a/client/src/telethon/_impl/client/types/album_builder.py b/client/src/telethon/_impl/client/types/album_builder.py index 059b2e89..e8ce6603 100644 --- a/client/src/telethon/_impl/client/types/album_builder.py +++ b/client/src/telethon/_impl/client/types/album_builder.py @@ -5,10 +5,10 @@ from pathlib import Path from typing import TYPE_CHECKING, Optional from ...tl import abcs, functions, types -from .chat import ChatLike from .file import InFileLike, try_get_url_path from .message import Message, generate_random_id, parse_message from .meta import NoPublicConstructor +from .peer import ChatLike if TYPE_CHECKING: from ..client.client import Client diff --git a/client/src/telethon/_impl/client/types/dialog.py b/client/src/telethon/_impl/client/types/dialog.py index 59890fba..181c9627 100644 --- a/client/src/telethon/_impl/client/types/dialog.py +++ b/client/src/telethon/_impl/client/types/dialog.py @@ -3,10 +3,10 @@ from __future__ import annotations from typing import TYPE_CHECKING, Optional, Self from ...tl import abcs, types -from .chat import Chat, peer_id from .draft import Draft from .message import Message from .meta import NoPublicConstructor +from .peer import Chat, peer_id if TYPE_CHECKING: from ..client.client import Client diff --git a/client/src/telethon/_impl/client/types/draft.py b/client/src/telethon/_impl/client/types/draft.py index 446af514..23c8863d 100644 --- a/client/src/telethon/_impl/client/types/draft.py +++ b/client/src/telethon/_impl/client/types/draft.py @@ -6,9 +6,9 @@ from typing import TYPE_CHECKING, Optional, Self from ...session import PackedChat from ...tl import abcs, functions, types from ..parsers import generate_html_message, generate_markdown_message -from .chat import Chat, expand_peer, peer_id from .message import Message, generate_random_id from .meta import NoPublicConstructor +from .peer import Chat, expand_peer, peer_id if TYPE_CHECKING: from ..client.client import Client diff --git a/client/src/telethon/_impl/client/types/inline_result.py b/client/src/telethon/_impl/client/types/inline_result.py index 92269540..3dd7a234 100644 --- a/client/src/telethon/_impl/client/types/inline_result.py +++ b/client/src/telethon/_impl/client/types/inline_result.py @@ -3,9 +3,9 @@ from __future__ import annotations from typing import TYPE_CHECKING, Optional from ...tl import abcs, functions, types -from .chat import ChatLike from .message import Message, generate_random_id from .meta import NoPublicConstructor +from .peer import ChatLike if TYPE_CHECKING: from ..client.client import Client diff --git a/client/src/telethon/_impl/client/types/message.py b/client/src/telethon/_impl/client/types/message.py index 8edd6504..d47a1e24 100644 --- a/client/src/telethon/_impl/client/types/message.py +++ b/client/src/telethon/_impl/client/types/message.py @@ -12,9 +12,9 @@ from ..parsers import ( parse_markdown_message, ) from .buttons import Button, as_concrete_row, create_button -from .chat import Chat, ChatLike, expand_peer, peer_id from .file import File from .meta import NoPublicConstructor +from .peer import Chat, ChatLike, expand_peer, peer_id if TYPE_CHECKING: from ..client.client import Client diff --git a/client/src/telethon/_impl/client/types/participant.py b/client/src/telethon/_impl/client/types/participant.py index 6f13a1af..e8634411 100644 --- a/client/src/telethon/_impl/client/types/participant.py +++ b/client/src/telethon/_impl/client/types/participant.py @@ -6,9 +6,9 @@ from typing import TYPE_CHECKING, Optional, Self, Sequence from ...session import PackedChat from ...tl import abcs, types from .admin_right import AdminRight -from .chat import Chat, User, peer_id from .chat_restriction import ChatRestriction from .meta import NoPublicConstructor +from .peer import Chat, User, peer_id if TYPE_CHECKING: from ..client.client import Client diff --git a/client/src/telethon/_impl/client/types/chat/__init__.py b/client/src/telethon/_impl/client/types/peer/__init__.py similarity index 100% rename from client/src/telethon/_impl/client/types/chat/__init__.py rename to client/src/telethon/_impl/client/types/peer/__init__.py diff --git a/client/src/telethon/_impl/client/types/chat/channel.py b/client/src/telethon/_impl/client/types/peer/channel.py similarity index 100% rename from client/src/telethon/_impl/client/types/chat/channel.py rename to client/src/telethon/_impl/client/types/peer/channel.py diff --git a/client/src/telethon/_impl/client/types/chat/chat.py b/client/src/telethon/_impl/client/types/peer/chat.py similarity index 100% rename from client/src/telethon/_impl/client/types/chat/chat.py rename to client/src/telethon/_impl/client/types/peer/chat.py diff --git a/client/src/telethon/_impl/client/types/chat/group.py b/client/src/telethon/_impl/client/types/peer/group.py similarity index 100% rename from client/src/telethon/_impl/client/types/chat/group.py rename to client/src/telethon/_impl/client/types/peer/group.py diff --git a/client/src/telethon/_impl/client/types/chat/user.py b/client/src/telethon/_impl/client/types/peer/user.py similarity index 100% rename from client/src/telethon/_impl/client/types/chat/user.py rename to client/src/telethon/_impl/client/types/peer/user.py diff --git a/client/src/telethon/_impl/client/types/recent_action.py b/client/src/telethon/_impl/client/types/recent_action.py index 02ed82f3..90481024 100644 --- a/client/src/telethon/_impl/client/types/recent_action.py +++ b/client/src/telethon/_impl/client/types/recent_action.py @@ -1,6 +1,6 @@ from ...tl import abcs, types -from .chat import Chat from .meta import NoPublicConstructor +from .peer import Chat class RecentAction(metaclass=NoPublicConstructor):