Commit Graph

28 Commits

Author SHA1 Message Date
03ed2bcf4e Обновлена ​​обработка статуса медиагрупп и улучшены интеграционные тесты
- Реализовано обновление статуса медиагрупп в `PostPublishService` при отклонении медиагрупп.

- Добавлены интеграционные тесты для обновления статусов постов и медиагрупп в `test_post_repository_integration.py

- Улучшен фиктивный репозиторий в `conftest_post_repository.py` для поддержки новых методов обновления статуса.

- Обновлены существующие тесты для проверки корректной обработки статуса постов и медиагрупп.
2026-01-22 23:52:48 +03:00
09e894e48f Обновление управления статусами сообщений и схемы базы данных
- Добавлены методы в `AsyncBotDB` и `PostRepository` для обновления статусов сообщений по идентификатору сообщения и для групп медиафайлов.

- Добавлено поле `status` в модель `TelegramPost` и обновлена ​​схема базы данных, чтобы включить это поле со значением по умолчанию 'suggest'.

- Обновлен `PostPublishService` для установки статусов сообщений на 'approved' или 'declined' в процессе публикации.
2026-01-22 23:37:27 +03:00
31e29cdec0 Update banned users handling with async support and improved date parsing
- Modified `change_page` function in `callback_handlers.py` to use async methods for retrieving banned users and their buttons.
- Enhanced `get_banned_users_list` in `helper_func.py` to handle string timestamps and various date formats, ensuring robust date parsing.
- Added a new test case in `test_utils.py` to validate the handling of string timestamps in the banned users list retrieval.
2025-09-08 23:19:19 +03:00
5f6882d348 Implement audio record management features in AsyncBotDB and AudioRepository
- Added methods to delete audio moderation records and retrieve all audio records in async_db.py.
- Enhanced AudioRepository with functionality to delete audio records by file name and retrieve all audio message records.
- Improved logging for audio record operations to enhance monitoring and debugging capabilities.
- Updated related handlers to ensure proper integration of new audio management features.
2025-09-05 01:31:50 +03:00
fc0517c011 Enhance bot functionality with new features and improvements
- Added a new `/status` endpoint in `server_prometheus.py` to provide process status information, including uptime and resource usage metrics.
- Implemented a PID manager in `run_helper.py` to track the bot's process, improving monitoring capabilities.
- Introduced a method to delete audio moderation records in `audio_repository.py`, enhancing database management.
- Updated voice message handling in callback handlers to ensure proper deletion of audio moderation records.
- Improved error handling and logging in various services, ensuring better tracking of media processing and file downloads.
- Refactored media handling functions to streamline operations and improve code readability.
- Enhanced metrics tracking for file downloads and media processing, providing better insights into bot performance.
2025-09-04 00:46:45 +03:00
ae7bd476bb Refactor metrics handling and remove scheduler
- Removed the metrics scheduler functionality from the bot, transitioning to real-time metrics updates via middleware.
- Enhanced logging for metrics operations across various handlers to improve monitoring and debugging capabilities.
- Integrated metrics tracking for user activities and database errors, providing better insights into bot performance.
- Cleaned up code by removing obsolete comments and unused imports, improving overall readability and maintainability.
2025-09-03 19:18:04 +03:00
1ab427a7ba Enhance admin handlers with improved logging and error handling
- Added detailed logging for user ban processing in `process_ban_target` and `process_ban_reason` functions, including user data and error messages.
- Improved error handling for user input validation and database interactions.
- Updated `return_to_admin_menu` function to log user return actions.
- Enhanced media group handling in `PostPublishService` with better error logging and author ID retrieval.
- Added new button options in voice handlers and updated keyboard layouts for improved user interaction.
- Refactored album middleware to better handle media group messages and added documentation for clarity.
2025-09-02 22:20:34 +03:00
1c6a37bc12 Enhance bot functionality and refactor database interactions
- Added `ca-certificates` installation to Dockerfile for improved network security.
- Updated health check command in Dockerfile to include better timeout handling.
- Refactored `run_helper.py` to implement proper signal handling and logging during shutdown.
- Transitioned database operations to an asynchronous model in `async_db.py`, improving performance and responsiveness.
- Updated database schema to support new foreign key relationships and optimized indexing for better query performance.
- Enhanced various bot handlers to utilize async database methods, improving overall efficiency and user experience.
- Removed obsolete database and fix scripts to streamline the project structure.
2025-09-02 18:22:02 +03:00
3a7b0f6219 Add voice bot welcome tracking functionality
- Implemented methods to check and mark if a user has received a welcome message from the voice bot in both async and synchronous database classes.
- Updated database schema to include a new field for tracking welcome message status.
- Enhanced voice handler to utilize the new tracking methods, improving user interaction flow and engagement metrics.
2025-09-01 19:43:46 +03:00
2d40f4496e Update voice bot functionality and clean up project structure
- Added voice message handling capabilities, including saving and deleting audio messages via callback queries.
- Refactored audio record management in the database to remove unnecessary fields and streamline operations.
- Introduced new keyboard options for voice interactions in the bot.
- Updated `.gitignore` to include voice user files for better project organization.
- Removed obsolete voice bot handler files to simplify the codebase.
2025-09-01 19:17:05 +03:00
d128e54694 Refactor project structure and remove obsolete files
- Deleted the Makefile, `README_TESTING.md`, and several deployment scripts to streamline the project.
- Updated `.dockerignore` to exclude unnecessary development files.
- Adjusted database schema comments for clarity.
- Refactored metrics handling in middleware for improved command extraction and logging.
- Enhanced command mappings for buttons and callbacks in constants for better maintainability.
- Start refactor voice bot
2025-09-01 00:54:10 +03:00
c68db87901 Refactor project structure and enhance Docker support
- Removed unnecessary `__init__.py` and `Dockerfile` to streamline project organization.
- Updated `.dockerignore` and `.gitignore` to improve exclusion patterns for build artifacts and environment files.
- Enhanced `Makefile` with new commands for managing Docker containers and added help documentation.
- Introduced `pyproject.toml` for better project metadata management and dependency tracking.
- Updated `requirements.txt` to reflect changes in dependencies for metrics and monitoring.
- Refactored various handler files to improve code organization and maintainability.
2025-08-29 16:49:28 +03:00
8cee629e28 Add middleware and refactor admin handlers for improved functionality
- Introduced `DependenciesMiddleware` and `BlacklistMiddleware` for enhanced request handling across all routers.
- Refactored admin handlers to utilize new middleware, improving access control and error handling.
- Updated the `admin_router` to include middleware for access checks and streamlined the process of banning users.
- Enhanced the structure of admin handler imports for better organization and maintainability.
- Improved error handling in various admin functions to ensure robust user interactions.
2025-08-28 23:54:17 +03:00
9688cdd85f Refactor admin handlers to improve access control and state management. Added checks for admin rights in ban functions and streamlined router inclusion order in main bot file. Updated keyboard layouts for better user experience and removed unused state definitions. 2025-08-27 00:28:32 +03:00
fee22f8ad4 Enhance database handling and improve HTML safety across the bot. Added async methods for blacklist checks, updated connection settings for SQLite, and implemented HTML escaping for user inputs and messages to prevent potential issues. Adjusted middleware latency and refactored various handlers for better performance and reliability. 2025-08-26 16:51:28 +03:00
7b6abe2a0e WIP: Temporary commit for branch move 2025-08-26 02:14:11 +03:00
5c3fece394 fix with html tags 2024-10-31 21:58:46 +03:00
Andrey
33fa84943d add answer for user 2024-07-21 13:24:18 +03:00
KatykhinAA
0704e6b3fe all type message can process 2024-07-20 22:41:48 +03:00
KatykhinAA
0b7f718f8a refactor MediaGroup. Add database 2024-07-20 16:54:43 +03:00
KatykhinAA
54234e59ec some fix 2024-07-20 14:18:58 +03:00
KatykhinAA
095e0398d0 some fix 2024-07-18 23:30:41 +03:00
KatykhinAA
a3b53d26e2 add mediaGroup func 2024-07-17 00:15:15 +03:00
KatykhinAA
88889fe87c mediaGroup start work 2024-07-16 22:25:32 +03:00
Andrey
3a30edc1ab HOT_FIX_3 add blacklist
fix db init
2024-07-16 21:55:22 +03:00
Andrey
09a071c014 HOT_FIX_2 for handle_start_message 2024-07-15 23:46:05 +03:00
KatykhinAA
f7f6fa5482 some fix 2024-07-15 22:28:36 +03:00
KatykhinAA
1a0344d0e8 migrate to aiogram 3.10.0 2024-07-14 21:22:33 +03:00