refactor app

This commit is contained in:
Dmitry Afanasyev 2022-08-09 23:45:32 +03:00
parent 295cc89853
commit 908e300301
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ async def echo(message: types.Message) -> SendMessage:
return SendMessage(message.chat.id, 'Выбери остановку', reply_markup=get_keyboard())
async def send_message(chat_ids: list[int]) -> None:
async def morning_bus_mailing(chat_ids: list[int]) -> None:
text = parse_site(
driver=driver,
url='https://yandex.ru/maps/213/moscow/stops/stop__9640740/'

View File

@ -1,4 +1,4 @@
from core.bot import send_message
from core.bot import morning_bus_mailing
cron_jobs = [
{'trigger': 'cron', 'day_of_week': 'mon-fri', 'hour': 8, 'minute': 59, 'second': 0},
@ -16,5 +16,5 @@ def asyncio_schedule() -> None:
scheduler = AsyncIOScheduler()
for cron in cron_jobs:
scheduler.add_job(send_message, kwargs=user_chat_ids, **cron)
scheduler.add_job(morning_bus_mailing, kwargs=user_chat_ids, **cron)
scheduler.start()