mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2025-09-11 13:00:40 +03:00
refactor app
This commit is contained in:
parent
295cc89853
commit
908e300301
@ -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/'
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user