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:
@@ -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]:
|
||||
"""
|
||||
Обновляет срок действия ключа клиента.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user