It's version 0.4

This commit is contained in:
Niken
2025-10-19 14:28:41 +03:00
parent 772d3d5b83
commit 7b653d4dcc
32 changed files with 775 additions and 326 deletions
+6 -4
View File
@@ -22,7 +22,7 @@ def register_handlers(dp: Dispatcher, state: BotState):
schedule_service = ScheduleService()
text, url, day, month = await schedule_service.get_schedule(group, day_offset)
# Отправляем текст расписания
msg = await message.answer(text, parse_mode="Markdown")
msg = await message.answer(text, parse_mode="Markdownv2")
save_message(message.chat.id, msg.message_id)
@@ -38,17 +38,19 @@ def register_handlers(dp: Dispatcher, state: BotState):
day_offset = int(args[2]) if len(args) > 2 and args[2].isdigit() else 0
schedule_service = ScheduleService()
clip_png, url, day, mouth = await schedule_service.get_pschedule(group, day_offset)
clip_png, url, day, mouth = await schedule_service.get_pschedule(
group, day_offset
)
if clip_png:
save_message(message.chat.id, message.message_id)
msg = await message.answer_photo(
types.BufferedInputFile(clip_png, filename=f"{group}.png"),
caption=f"Расписание для {group} на {day}.{mouth:02d}"
caption=f"Расписание для {group} на {day}.{mouth:02d}",
)
save_message(message.chat.id, msg.message_id)
state.file_id_cache[group.lower()] = msg.photo[-1].file_id
else:
await message.answer(f"Не удалось найти расписание для {group}")
await message.answer(f"Не удалось найти расписание для {group}")