From d996844726351159585fc5973474d8e49adb29ff Mon Sep 17 00:00:00 2001 From: yogurtmenn Date: Tue, 25 Mar 2025 07:00:20 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20bot-tg.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot-tg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot-tg.py b/bot-tg.py index 5b414fa..a83e76f 100644 --- a/bot-tg.py +++ b/bot-tg.py @@ -8,7 +8,7 @@ import asyncio # настройка логов logger = logging.getLogger() -logger.setLevel(logging.DEBUG) # Включаем детальное логирование +logger.setLevel(logging.DEBUG) formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s' @@ -74,7 +74,7 @@ async def get_weather(message: types.Message): logging.info(f"Запрос погоды для: {city} (от {message.from_user.id})") try: - # Запрос к API + # запрос к API url = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid={WEATHER_API_KEY}&units=metric&lang=ru" response = requests.get(url, timeout=10) @@ -88,7 +88,7 @@ async def get_weather(message: types.Message): data = response.json() - # Формирование ответа + # формирование ответа weather_report = ( f"Город: {data['name']}\n" f"Температура: {data['main']['temp']:.1f}°C\n"