- utils/pogoda.py: добавлена API_URL_WEATHER, format_weather_for_embed(), проверка None в format_weather_data_for_console() - utils/morning_runner.py: вынесен MorningData (dataclass) и gather_morning(); run_morning() использует их вместо ручного asyncio.gather - utils/__init__.py: экспортирован публичный API (__all__) - commands/pg.py: убран ручной парсинг погоды, используется format_weather_data_for_console() - console_commands/morning.py: дубликат asyncio.gather заменён на gather_morning() - console_commands/pogoda.py: хардкод URL заменён на API_URL_WEATHER - console_commands/cat.py: заглушка заменена на рабочий вызов fetch_cat() - tests/test_commands_pg.py: обновлён тест fetch_returns_none (бот теперь отправляет сообщение об ошибке вместо молчаливого возврата)
39 lines
772 B
Python
39 lines
772 B
Python
from .pogoda import (
|
|
API_URL_WEATHER,
|
|
fetch_weather,
|
|
fetch_open_meteo,
|
|
format_weather_data_for_console,
|
|
format_weather_for_embed,
|
|
pressure_to_mmhg,
|
|
translate_weather,
|
|
wmo_to_russian,
|
|
)
|
|
from .news import (
|
|
RSS_URL_ARTICLES,
|
|
RSS_URL_POSTS,
|
|
fetch_rss,
|
|
format_articles,
|
|
truncate_title,
|
|
)
|
|
from .cat import fetch_cat
|
|
|
|
__all__ = [
|
|
# Погода
|
|
"API_URL_WEATHER",
|
|
"fetch_weather",
|
|
"fetch_open_meteo",
|
|
"format_weather_data_for_console",
|
|
"format_weather_for_embed",
|
|
"pressure_to_mmhg",
|
|
"translate_weather",
|
|
"wmo_to_russian",
|
|
# Новости
|
|
"RSS_URL_ARTICLES",
|
|
"RSS_URL_POSTS",
|
|
"fetch_rss",
|
|
"format_articles",
|
|
"truncate_title",
|
|
# Котики
|
|
"fetch_cat",
|
|
]
|