From ff57e35f534476ce22764b365de08a6cb3b6ed1c Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 26 Sep 2024 14:13:33 +0300 Subject: [PATCH] polling-log2 --- bot/api.py | 8 ++++---- main.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/api.py b/bot/api.py index 33e469c..3c4a3a1 100644 --- a/bot/api.py +++ b/bot/api.py @@ -18,12 +18,12 @@ async def telegram_api(endpoint: str, json_data=None, **kwargs): headers = {'Content-Type': 'application/json'} async with aiohttp.ClientSession() as session: url = api_base + f"{endpoint}?{urlencode(kwargs)}" - if not is_polling: - logger.info(f' >>> {url} {json_data if json_data else ""}') + #if not is_polling: + logger.info(f' >>> {url} {json_data if json_data else ""}') async with session.get(url, data=json.dumps(json_data), headers=headers) as response: data = await response.json() - if not is_polling: - logger.info(f' <<< {data}') + # if not is_polling: + logger.info(f' <<< {data}') return data except Exception as ex: import traceback diff --git a/main.py b/main.py index 8466be4..c1b6535 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,7 @@ async def start(): offset = 0 # init offset while True: response = await telegram_api("getUpdates", offset=offset, allowed_updates=['message', 'message_reaction']) - logger.debug(response) + # logger.debug(response) if isinstance(response, dict): result = response.get("result", []) for update in result: