From 8a104befca17e31b43f25cb35c0ad842520e0352 Mon Sep 17 00:00:00 2001 From: illvart Date: Fri, 2 Feb 2024 01:57:23 +0700 Subject: [PATCH] Update --- getter/core/base_client.py | 1 + getter/core/patched/__init__.py | 2 +- getter/core/patched/client.py | 8 +------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/getter/core/base_client.py b/getter/core/base_client.py index e31b9f8..13783c6 100644 --- a/getter/core/base_client.py +++ b/getter/core/base_client.py @@ -57,6 +57,7 @@ def __init__( ): self._dialogs = [] self._plugins = {} + self.log = LOG kwargs["api_id"] = api_id kwargs["api_hash"] = api_hash kwargs["request_retries"] = 3 diff --git a/getter/core/patched/__init__.py b/getter/core/patched/__init__.py index b78670a..96a146c 100644 --- a/getter/core/patched/__init__.py +++ b/getter/core/patched/__init__.py @@ -5,6 +5,6 @@ # Please read the GNU Affero General Public License in # < https://github.com/kastaid/getter/blob/main/LICENSE/ >. -from .client import Client +from .client import TelegramClient from .conversation import Conversation from .message import Message diff --git a/getter/core/patched/client.py b/getter/core/patched/client.py index 4b2f23a..243f464 100644 --- a/getter/core/patched/client.py +++ b/getter/core/patched/client.py @@ -5,7 +5,6 @@ # Please read the GNU Affero General Public License in # < https://github.com/kastaid/getter/blob/main/LICENSE/ >. -import logging import typing from asyncio import sleep from random import randrange @@ -15,17 +14,12 @@ from getter.core.constants import MAX_MESSAGE_LEN from getter.core.functions import get_chat_id, get_text, get_user from getter.core.patcher import patch, patchable -from getter.logger import LOG delattr(fun.account, "DeleteAccountRequest") @patch(telethon.client.telegramclient.TelegramClient) -class Client(telethon.client.telegramclient.TelegramClient): - @patchable(True) - def log(self) -> logging: - return LOG - +class TelegramClient: @patchable() async def get_id(self, entity: hints.EntityLike) -> int: try: