From 6c323dc7df9dfe55d393366bb12a8cdbfd8a3d77 Mon Sep 17 00:00:00 2001 From: Zakhar Izmaylov Date: Thu, 23 Jan 2025 08:50:04 +0300 Subject: [PATCH] Refactor client configuration and improve code clarity in client.py and admin_servers.py. Added a new line in ClientConfig for better readability and updated the extend_client_key function signature for consistency. Corrected a TODO comment format in admin_servers.py for improved code standards. --- client.py | 9 ++------- handlers/admin/admin_servers.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/client.py b/client.py index e1995d53..8c4d452c 100644 --- a/client.py +++ b/client.py @@ -9,6 +9,7 @@ from logger import logger @dataclass class ClientConfig: """Конфигурация клиента для добавления/обновления.""" + client_id: str email: str tg_id: str @@ -64,13 +65,7 @@ async def add_client(xui: py3xui.API, config: ClientConfig) -> Dict[str, Any]: async def extend_client_key( - xui: py3xui.API, - inbound_id: int, - email: str, - new_expiry_time: int, - client_id: str, - total_gb: int, - sub_id: str + xui: py3xui.API, inbound_id: int, email: str, new_expiry_time: int, client_id: str, total_gb: int, sub_id: str ) -> Optional[bool]: """ Обновляет срок действия ключа клиента. diff --git a/handlers/admin/admin_servers.py b/handlers/admin/admin_servers.py index 1fd5dcd9..151475a8 100644 --- a/handlers/admin/admin_servers.py +++ b/handlers/admin/admin_servers.py @@ -300,7 +300,7 @@ async def sync_cluster_handler(callback_query: types.CallbackQuery): conn = await asyncpg.connect(DATABASE_URL) try: - #TODO + # TODO query_keys = """ SELECT tg_id, client_id, email, expiry_time FROM keys