diff --git a/telethon/client/account.py b/telethon/client/account.py index b6a2e1e7..eaa4cf89 100644 --- a/telethon/client/account.py +++ b/telethon/client/account.py @@ -2,7 +2,7 @@ import functools import inspect import typing -from .users import UserMethods, _NOT_A_REQUEST +from .users import _NOT_A_REQUEST from .. import helpers, utils from ..tl import functions, TLRequest @@ -107,7 +107,7 @@ class _TakeoutClient: return setattr(self.__client, name, value) -class AccountMethods(UserMethods): +class AccountMethods: def takeout( self: 'TelegramClient', finalize: bool = True, diff --git a/telethon/client/auth.py b/telethon/client/auth.py index 85654592..c201c112 100644 --- a/telethon/client/auth.py +++ b/telethon/client/auth.py @@ -4,8 +4,6 @@ import os import sys import typing -from .messageparse import MessageParseMethods -from .users import UserMethods from .. import utils, helpers, errors, password as pwd_mod from ..tl import types, functions @@ -13,7 +11,7 @@ if typing.TYPE_CHECKING: from .telegramclient import TelegramClient -class AuthMethods(MessageParseMethods, UserMethods): +class AuthMethods: # region Public methods diff --git a/telethon/client/bots.py b/telethon/client/bots.py index e8f87bed..72efdd9e 100644 --- a/telethon/client/bots.py +++ b/telethon/client/bots.py @@ -1,6 +1,5 @@ import typing -from .users import UserMethods from .. import hints from ..tl import types, functions, custom @@ -8,7 +7,7 @@ if typing.TYPE_CHECKING: from .telegramclient import TelegramClient -class BotMethods(UserMethods): +class BotMethods: async def inline_query( self: 'TelegramClient', bot: 'hints.EntityLike', diff --git a/telethon/client/buttons.py b/telethon/client/buttons.py index 7b73d369..aa6b7fa1 100644 --- a/telethon/client/buttons.py +++ b/telethon/client/buttons.py @@ -1,14 +1,10 @@ import typing -from .updates import UpdateMethods from .. import utils, hints from ..tl import types, custom -if typing.TYPE_CHECKING: - from .telegramclient import TelegramClient - -class ButtonMethods(UpdateMethods): +class ButtonMethods: @staticmethod def build_reply_markup( buttons: 'typing.Optional[hints.MarkupLike]', diff --git a/telethon/client/chats.py b/telethon/client/chats.py index f1bb6040..7f5f804c 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -3,7 +3,6 @@ import itertools import string import typing -from .users import UserMethods from .. import helpers, utils, hints from ..requestiter import RequestIter from ..tl import types, functions, custom @@ -345,7 +344,7 @@ class _ProfilePhotoIter(RequestIter): self.request.offset_id = result.messages[-1].id -class ChatMethods(UserMethods): +class ChatMethods: # region Public methods diff --git a/telethon/client/dialogs.py b/telethon/client/dialogs.py index 75f59fef..c388ac52 100644 --- a/telethon/client/dialogs.py +++ b/telethon/client/dialogs.py @@ -2,7 +2,6 @@ import asyncio import itertools import typing -from .users import UserMethods from .. import utils, hints from ..requestiter import RequestIter from ..tl import types, functions, custom @@ -104,7 +103,7 @@ class _DraftsIter(RequestIter): return [] -class DialogMethods(UserMethods): +class DialogMethods: # region Public methods diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 60c071e4..10e22781 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -4,7 +4,6 @@ import os import pathlib import typing -from .users import UserMethods from .. import utils, helpers, errors, hints from ..requestiter import RequestIter from ..tl import TLObject, types, functions @@ -152,7 +151,7 @@ class _GenericDownloadIter(_DirectDownloadIter): self.request.offset -= self._stride -class DownloadMethods(UserMethods): +class DownloadMethods: # region Public methods diff --git a/telethon/client/messageparse.py b/telethon/client/messageparse.py index 4a0723f0..80eabbb2 100644 --- a/telethon/client/messageparse.py +++ b/telethon/client/messageparse.py @@ -2,7 +2,6 @@ import itertools import re import typing -from .users import UserMethods from .. import utils from ..tl import types @@ -10,7 +9,7 @@ if typing.TYPE_CHECKING: from .telegramclient import TelegramClient -class MessageParseMethods(UserMethods): +class MessageParseMethods: # region Public properties diff --git a/telethon/client/messages.py b/telethon/client/messages.py index cfb79462..54b262da 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -1,9 +1,6 @@ import itertools import typing -from .buttons import ButtonMethods -from .messageparse import MessageParseMethods -from .uploads import UploadMethods from .. import utils, errors, hints from ..requestiter import RequestIter from ..tl import types, functions @@ -292,7 +289,7 @@ class _IDsIter(RequestIter): return True # no next chunk, all done in init -class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods): +class MessageMethods: # region Public methods diff --git a/telethon/client/telegramclient.py b/telethon/client/telegramclient.py index 60e94a03..144a6b2f 100644 --- a/telethon/client/telegramclient.py +++ b/telethon/client/telegramclient.py @@ -1,13 +1,13 @@ from . import ( AccountMethods, AuthMethods, DownloadMethods, DialogMethods, ChatMethods, BotMethods, MessageMethods, UploadMethods, ButtonMethods, UpdateMethods, - MessageParseMethods, UserMethods + MessageParseMethods, UserMethods, TelegramBaseClient ) class TelegramClient( AccountMethods, AuthMethods, DownloadMethods, DialogMethods, ChatMethods, BotMethods, MessageMethods, UploadMethods, ButtonMethods, UpdateMethods, - MessageParseMethods, UserMethods + MessageParseMethods, UserMethods, TelegramBaseClient ): pass diff --git a/telethon/client/updates.py b/telethon/client/updates.py index 69333a8a..17fc82ac 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -4,7 +4,6 @@ import random import time import typing -from .users import UserMethods from .. import events, utils, errors from ..events.common import EventBuilder, EventCommon from ..tl import types, functions @@ -13,7 +12,7 @@ if typing.TYPE_CHECKING: from .telegramclient import TelegramClient -class UpdateMethods(UserMethods): +class UpdateMethods: # region Public methods diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index a930d198..a405cccc 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -7,9 +7,6 @@ import re import typing from io import BytesIO -from .buttons import ButtonMethods -from .messageparse import MessageParseMethods -from .users import UserMethods from .. import utils, helpers, hints from ..tl import types, functions, custom @@ -84,7 +81,7 @@ def _resize_photo_if_needed( file.seek(before, io.SEEK_SET) -class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods): +class UploadMethods: # region Public methods diff --git a/telethon/client/users.py b/telethon/client/users.py index e5c31b11..fafff8cd 100644 --- a/telethon/client/users.py +++ b/telethon/client/users.py @@ -3,7 +3,6 @@ import itertools import time import typing -from .telegrambaseclient import TelegramBaseClient from .. import errors, utils, hints from ..errors import MultiError, RPCError from ..helpers import retry_range @@ -15,7 +14,7 @@ if typing.TYPE_CHECKING: from .telegramclient import TelegramClient -class UserMethods(TelegramBaseClient): +class UserMethods: async def __call__(self: 'TelegramClient', request, ordered=False): requests = (request if utils.is_list_like(request) else (request,)) for r in requests: