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.

This commit is contained in:
Zakhar Izmaylov
2025-01-23 08:50:04 +03:00
parent 70e9bfc2ca
commit c850698703
2 changed files with 3 additions and 8 deletions
+2 -7
View File
@@ -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]:
"""
Обновляет срок действия ключа клиента.
+1 -1
View File
@@ -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