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"