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
+9 -10
View File
@@ -2,7 +2,6 @@ import asyncio
from datetime import datetime, timedelta
from random import randint
from aiogram import Bot
from aiogram.types import BufferedInputFile
from models.state import BotState
from config import Config
from services.schedule_service import ScheduleService
@@ -74,21 +73,21 @@ class WatcherService:
async def _check_group_schedule(self, group: str, chat_id: int, day: int):
"""Проверка расписания для конкретной группы"""
clip_png, url, data_day, data_mouth = await self.schedule_service.get_schedule(group, day)
if clip_png:
msg = await self.bot.send_photo(
text, url, data_day, data_month = await self.schedule_service.get_schedule(group, day)
if text and "не найдено" not in text.lower():
msg = await self.bot.send_message(
chat_id,
BufferedInputFile(clip_png, filename=f"{group}.png"),
caption=f"Авто-расписание для {group} на {data_day:02d}.{data_mouth:02d}"
f"Авто-расписание для {group} на {data_day:02d}.{data_month:02d}\n\n{text}",
parse_mode="Markdown"
)
await self.bot.pin_chat_message(chat_id, msg.message_id, disable_notification=True)
else:
logger.warning(f"Не удалось получить расписание для {group}, {data_day}, {data_mouth}, {url}")
logger.warning(
f"Не удалось получить расписание для {group}, {data_day}, {data_month}, {url}"
)
return
#clip_hash = hashlib.md5(clip_png).hexdigest()
# Логика проверки изменений и отправки сообщений