Skip to content

Latest commit

 

History

58 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The documentation for this project is available in a few languages:

EN

Documentation for school_tg_bot 🚀

Project Overview

school_tg_bot is a Telegram bot designed to streamline students’ access to information about schedules, homework, and grades 📚. The bot enables users to quickly retrieve up-to-date data on classes, assignments, and academic performance, enhancing the learning experience.

The project aims to optimize the educational process, keeping students informed of their responsibilities and providing easy access to information, unlike the school portal 😊.

Key Features

  1. Homework:

    • View homework for the current day or the entire week based on user settings 🛠️.
    • Homework is fetched from the school website, ensuring data accuracy 💾.
  2. Schedule:

    • Request schedules for the current day or the week 📆.
  3. Grades:

    • Check grades for the current day or week based on user preferences.
  4. User Settings:

    • Customize homework display (daily or weekly) and notification preferences (enabled/disabled).
    • Settings are saved and modified at any time ⏳.
  5. Logging:

    • All user actions and errors are logged using the loguru library, facilitating monitoring and debugging 🗿.

Technical Details

Installation

  1. Clone the repository: git clone https://github.com/Lynx20wz/school_tg_bot.
  2. Install dependencies: pip install -r requirements.txt.
  3. Start the bot: python . or Start_tg_bot.cmd.

Allowable start arguments

  • -back - the database backup will not be loaded when the bot is started.
  • -debug - the bot will be launched in debug mode (additional logs).

Libraries Used

  •  Aiogram — Asynchronous library for the Telegram API 📋.
  •  Aiosqlite — Asynchronous SQLite operations �️.
  • Loguru — Logging of actions and errors 📜.
  • Requests — HTTP requests to the school portal for schedules and assignments 🚀.

Selenium — Token parsing (deprecated).

Project structure
root
  • __main__.py — Program entry point.
  • start_tg_bot.cmd — Script for launching the bot in the terminal.
  • LICENSE — Project license.
  • README.md — Project description.
  • pyproject.toml — Project configuration.
  • requirements.txt — Bot dependencies.
bot

bin

  • bot.py — Core logic for Telegram API interaction.

classes

  • BaseData.py — Class for SQLite database operations.
  • UserClass.py — Class for storing user data.
  • Homework.py — Class for handling homework.
  • Parser.py — Class for parsing "My School" data.

filters

  • is_admin.py — Administrator filter.

handlers

  • registration.py — Authorization and token handling.
  • debug.py — Debugging functions.
  • unknown.py — Handling unknown messages.

utils

  • get_token.py — Token retrieval (deprecated).
  • Keyboards.py — Functions for creating aiogram keyboards.
  • Exceptions.py — Custom exception classes.

TODO List

Core Tasks 🛠️

  • (6d42) User authorization.
  • (e0ae) Database (SQLite).
  • (4c95) Token absence.
  • Middleware-level logging. notifications for homework, grades, and schedules.
  • "My School" API system based on OOP:
    • (29e6) Homework class.
    • (003e) Parser class.
    • Schedule class.
    • Grades class.
    • "My School" API class.
  • School supplies checklist 📝✅.
  • Grade notifications 🔔.
  • Deployment to a standalone server.
  • Notifications for new homework/grades after lessons.
  • Support for other school diaries.
  • Caching with Redis.

Assignment Solutions 🔢✅

  • Automatic submission of digital assignment answers.
  • Custom solution system (a dream).
  • Automatic solving of digital assignments.

Settings ⚙️

  • (5f43) Homework display settings (daily/weekly) 🛠️.
  • (5f43) Notification management 🔔.

Contributing

  1. Fork the repository.
  2. Make your changes.
  3. Create a Pull Request.

License

The project is licensed under the MIT License. See LICENSE for details.


"Thank you for your attention!" — Lynx20wz

RU

Документация для school_tg_bot 🚀

Описание проекта

school_tg_bot — это Telegram-бот, созданный для упрощения доступа школьников к информации о расписании, домашних заданиях и оценках 📚. Бот позволяет быстро получать актуальные данные о занятиях, заданиях и успеваемости, делая учебный процесс удобнее.

Проект направлен на оптимизацию учебного процесса, помогая учащимся быть в курсе своих обязанностей и предоставляя простой доступ к информации, в отличие от школьного портала 😊.

Основные функции

  1. Домашние задания:

    • Просмотр домашних заданий на текущий день или на неделю в зависимости от пользовательских настроек 🛠️.
    • Данные загружаются с сайта школы, что гарантирует их актуальность 💾.
  2. Расписание:

    • Запрос расписания на текущий день или на неделю 📆.
  3. Оценки:

    • Просмотр оценок за текущий день или неделю в зависимости от настроек.
  4. Настройки пользователя:

    • Настройка отображения домашних заданий (на день или неделю) и уведомлений ( включены/выключены).
    • Все настройки сохраняются и могут быть изменены в любой момент ⏳.
  5. Логирование:

    • Все действия пользователей и ошибки записываются с помощью библиотеки loguru, что упрощает мониторинг и отладку бота 🔍.

Технические детали

Установка

  1. Клонируйте репозиторий: git clone https://github.com/Lynx20wz/school_tg_bot.
  2. Установите зависимости: pip install -r requirements.txt.
  3. Запустите бота: python . или Start_tg_bot.cmd.

Допустимые аргументы запуска

  • -back - бэкап базы данных не будет загружаться при запуске бота.
  • -debug - бот будет запускаться в режиме отладки (дополнительные логи).

Используемые библиотеки

  •  Aiogram — асинхронная библиотека для работы с Telegram API 📞.
  •  Aiosqlite — асинхронная работа с базами данных SQLite 🗄️.
  •  Loguru — логирование действий и ошибок 🔍.
  •  Requests — HTTP-запросы к школьному порталу для получения расписаний и заданий 🚀.
  •  Selenium — парсинг токенов авторизации 🔑 (устарело).
Структура проекта
Корень
  • __main__.py — точка входа в программу.
  • start_tg_bot.cmd — скрипт для быстрого запуска бота в терминале.
  • LICENSE — лицензия проекта.
  • README.md — описание проекта.
  • pyproject.toml — конфигурация проекта.
  • requirements.txt — зависимости бота.
bot

bin

  • bot.py — основная логика взаимодействия с Telegram API.

classes

  • BaseData.py — класс для работы с базой данных (SQLite).
  • UserClass.py — класс для хранения данных пользователя.
  • Homework.py — класс для обработки домашних заданий.
  • Parser.py — класс для парсинга данных "Моя школа".

filters

  • is_admin.py — фильтр для администраторов.

handlers

  • registration.py — обработка авторизации и получения токена.
  • debug.py — функции для отладки.
  • unknown.py — обработка неизвестных сообщений.

utils

  • get_token.py — получение токена (устарело).
  • Keyboards.py — функции для создания клавиатур aiogram.
  • Exceptions.py — пользовательские исключения.

TODO-лист

Основные задачи 🛠️

  • (6d42) Авторизация пользователей.
  • (e0ae) База данных (SQLite).
  • (4c95) Уведомления об отсутствии токена для заданий, оценок и расписания.
  • Система API "Моя школа" на основе ООП:
    • (29e6) Класс Homework.
    • (003e) Класс Parser.
    • Класс Schedule.
    • Класс Grades.
    • Класс API "Моя школа".
  • Чек-лист подготовки школьных принадлежностей 📝✅.
  • Уведомления о новых оценках 🔔.
  • Разворачивание на автономном сервере.
  • Уведомления о новых заданиях и оценках после уроков.
  • Поддержка других школьных дневников.
  • Логирование на уровне middleware.
  • Кеширование с использованием Redis.

Решения заданий 🔢✅

  • Автоматическая отправка ответов на цифровые задания.
  • Собственная система решений (мечта).
  • Автоматическое решение цифровых заданий.

Настройки ⚙️

  • (5f43) Выбор отображения заданий (день/неделя) 🛠️.
  • (5f43) Управление уведомлениями 🔔.

Как внести вклад

  1. Сделайте форк репозитория.
  2. Внесите изменения.
  3. Создайте Pull Request.

Лицензия

Проект распространяется под лицензией MIT. Подробности — в файле LICENSE.


"Спасибо за внимание!" — Lynx20wz

About

This project is a Telegram bot designed to make it easy for students to interact with schedule and homework information 📚. The bot provides users with the ability to quickly and conveniently receive up-to-date information about classes, homework and notification settings.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages