I add command /prasp

It's version 0.2.2
This commit is contained in:
Niken
2025-10-05 22:29:49 +03:00
parent c5f6da31ba
commit 3ef1327b67
4 changed files with 89 additions and 14 deletions
+19 -1
View File
@@ -19,7 +19,25 @@ def register_handlers(dp: Dispatcher, state: BotState, bot: Bot):
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_schedule(group, day_offset)
text, url, day, month = await schedule_service.get_schedule(group, day_offset)
# Отправляем текст расписания
msg = await message.answer(text, parse_mode="Markdown")
save_message(message.chat.id, msg.message_id)
@dp.message(Command("prasp"))
async def send_schedule(message: types.Message):
"""Отправка расписания"""
if is_chat_spam(message.chat.id, state):
await message.answer("НЕ СПАМЬТЕ!!!")
return
args = message.text.split(maxsplit=2)
group = args[1].strip() if len(args) > 1 else "30тс"
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)
if clip_png:
save_message(message.chat.id, message.message_id)