Compare commits
No commits in common. "f55a47f166527ccd851cbb85ca7a5fe243ef7823" and "a8bd42a531e6a1d91c03182b5470b22b971be12e" have entirely different histories.
f55a47f166
...
a8bd42a531
6 changed files with 6 additions and 39 deletions
30
AGENTS.md
30
AGENTS.md
|
|
@ -1,30 +0,0 @@
|
|||
# About
|
||||
This project: Telegram bot for displaying schedule for groups of students
|
||||
Validate and run project via `uv`
|
||||
|
||||
### Commit message rules:
|
||||
`{fix|add|impl|bot|event|web|any other...}: {message}`
|
||||
|
||||
# Folders:
|
||||
## `./events/`
|
||||
Separate event system implementation, i.e.: notifications about upcoming lessons
|
||||
|
||||
## `./bot/`
|
||||
Main interactions with bot
|
||||
|
||||
## `./models/`
|
||||
Main implementations
|
||||
|
||||
## `./web/`
|
||||
Folder for static web content
|
||||
|
||||
## `./utils/schedule_client.py`
|
||||
Main schedule database client to communicate with. Autogenerated from private repo, don't modify
|
||||
|
||||
# How to run
|
||||
Copy `./config.example.py` to `./config.py`
|
||||
Fill all variables in `./config.py`
|
||||
Run via `uv run main.py`
|
||||
|
||||
|
||||
...anything else???
|
||||
|
|
@ -48,7 +48,7 @@ def start(message: Message):
|
|||
Просто имей это ввиду😥
|
||||
''')
|
||||
|
||||
#FIXME
|
||||
#EDIT
|
||||
send(message, 'Выбери свой факультет' if not u else '<i>Вы начали процедуру перезапуска бота. Все настройки и данные удалены, включая уведомления</i>\nВыбери новый факультет', reply_markup = Markup.selectTopic())
|
||||
|
||||
|
||||
|
|
|
|||
0
groups/.empty
Normal file
0
groups/.empty
Normal file
|
|
@ -167,7 +167,7 @@ class Markup_v1:
|
|||
|
||||
@staticmethod
|
||||
def selectGroup(query: str) -> ReplyKeyboardMarkup:
|
||||
#FIXME
|
||||
#EDIT
|
||||
schedule = sc.ScheduleDB(api_url=config.SCHEDULE_BASE_URL)
|
||||
groupList = schedule.query(sc.Group).filter_by(name=query)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import config as _config
|
|||
dayStrings = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье']
|
||||
|
||||
class Lesson:
|
||||
#FIXME: фулл переделать потому-что формат поменялся сильно
|
||||
#EDIT: фулл переделать потому-что формат поменялся сильно
|
||||
def __init__(self, start_end: str, data: dict) -> None:
|
||||
self.start: list[int] = [
|
||||
int(start_end.split(' - ')[0].split(':')[0]),
|
||||
|
|
@ -67,7 +67,7 @@ class Lesson:
|
|||
|
||||
return f'''\
|
||||
<blockquote>\
|
||||
<b>{self.name}</b>#FIXME
|
||||
<b>{self.name}</b>
|
||||
{dateStr}
|
||||
{wrb[2:] if wrb else 'Дополнительная информация отсуствует'}</blockquote>'''
|
||||
|
||||
|
|
@ -105,7 +105,6 @@ class Schedule:
|
|||
return self.days[self.weekDay] if self.weekDay < 5 else []
|
||||
|
||||
def getFacCourseByGroup(group: str) -> tuple[str | None, str | None]:
|
||||
#FIXME
|
||||
for faculty, courses in _config.LOAD.items():
|
||||
for course in courses:
|
||||
path = f'./timetables/{faculty} {course}.json'.replace(' ', '_')
|
||||
|
|
@ -121,7 +120,6 @@ def getFacCourseByGroup(group: str) -> tuple[str | None, str | None]:
|
|||
return None, None
|
||||
|
||||
def getSchedulePathByGroup(group: str) -> str | None:
|
||||
#FIXME
|
||||
faculty, course = getFacCourseByGroup(group)
|
||||
return None if not faculty else f'./timetables/{faculty} {course}.json'.replace(' ', '_')
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ class User:
|
|||
|
||||
self.state: str | bool | None = self.data.get("state", None)
|
||||
|
||||
# self.topic: str | None = self.data.get("topic", None)
|
||||
# self.course: str | None = self.data.get("course", None)
|
||||
self.topic: str | None = self.data.get("topic", None)
|
||||
self.course: str | None = self.data.get("course", None)
|
||||
self.group: str | None = self.data.get("group", None)
|
||||
self.notifications: list[str] = self.data.get("notifications", []) # type: ignore
|
||||
self.valid: bool = self.data.get("valid", True)
|
||||
|
|
@ -53,7 +53,6 @@ class User:
|
|||
|
||||
def schedule(self) -> Schedule | None:
|
||||
date = datetime.datetime.now()
|
||||
#FIXME
|
||||
path = getSchedulePathByGroup(self.group)
|
||||
if not path:
|
||||
self.valid = False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue