diff --git a/client.py b/client.py index 81403e3f..a5566e47 100644 --- a/client.py +++ b/client.py @@ -13,7 +13,7 @@ async def add_client( expiry_time: int, enable: bool, flow: str, - inbound_id: int, + inbound_id: int, ): """ Adds a client to the server via 3x-ui. diff --git a/handlers/keys/key_utils.py b/handlers/keys/key_utils.py index 9c18756a..d6dab999 100644 --- a/handlers/keys/key_utils.py +++ b/handlers/keys/key_utils.py @@ -98,6 +98,7 @@ async def renew_key_in_cluster(cluster_id, email, client_id, new_expiry_time, to logger.error(f"Не удалось продлить ключ {client_id} в кластере {cluster_id}: {e}") raise e + async def delete_key_from_db(client_id, session): try: await session.execute("DELETE FROM keys WHERE client_id = $1", client_id) @@ -183,4 +184,4 @@ async def update_key_on_cluster(tg_id, client_id, email, expiry_time, cluster_id except Exception as e: logger.error(f"Ошибка при обновлении ключа на серверах кластера {cluster_id} для {client_id}: {e}") - raise e \ No newline at end of file + raise e diff --git a/handlers/keys/trial_key.py b/handlers/keys/trial_key.py index 8cf10ecf..70d5adfe 100644 --- a/handlers/keys/trial_key.py +++ b/handlers/keys/trial_key.py @@ -5,7 +5,7 @@ import uuid from py3xui import AsyncApi from client import add_client -from config import ADMIN_PASSWORD, ADMIN_USERNAME, CLUSTERS, PUBLIC_LINK, TRIAL_TIME, TOTAL_GB +from config import ADMIN_PASSWORD, ADMIN_USERNAME, CLUSTERS, PUBLIC_LINK, TOTAL_GB, TRIAL_TIME from database import store_key, use_trial from handlers.texts import INSTRUCTIONS from handlers.utils import generate_random_email, get_least_loaded_cluster