diff --git a/src/core/api_request.py b/src/core/api_request.py index 16c7c6a..b6d9336 100644 --- a/src/core/api_request.py +++ b/src/core/api_request.py @@ -7,7 +7,7 @@ import requests from aiohttp import ClientError from src import logger -from src.core.constant import BOT_TOKEN, CHAT_ID +from src.core.constant import BOT_TOKEN, GROUP_ID from src.core.login import login from src.core.message_client import send_message from src.entity.account import Account @@ -60,13 +60,13 @@ def account_post(url: str, account: Account, params: dict) -> ApiResponse[Any]: logger.error(f"Client error occurred: {e}") except TimeoutError as e: logger.error(f"") - send_message(BOT_TOKEN, CHAT_ID, f'{account.url}:加载超时,请检查是否后台更换了链接') + send_message(BOT_TOKEN, GROUP_ID, f'{account.url}:加载超时,请检查是否后台更换了链接') except Exception as e: logger.error(f"Unknown error: {e}") time.sleep(10) - send_message(BOT_TOKEN, CHAT_ID, f'{account.url}: Retry limit exceeded, please check the code') + send_message(BOT_TOKEN, GROUP_ID, f'{account.url}: Retry limit exceeded, please check the code') logger.error(f"{account.url}: Retry limit exceeded, please check the code") @@ -88,6 +88,5 @@ async def async_account_post(url: str, account: Account, params: dict) -> ApiRes # Add a delay before retrying await asyncio.sleep(10) - send_message(BOT_TOKEN, CHAT_ID, f'{account.url}: Retry limit exceeded, please check the code') + send_message(BOT_TOKEN, GROUP_ID, f'{account.url}: Retry limit exceeded, please check the code') logger.error("Retry limit exceeded, please check the code") - # You can raise a custom exception here or return an error status code