[4.0.0] - 2024-11-17
[4.0.0] - 2024-11-17
Breaking Changes:
- Overhauled project structure, transitioning to PostgreSQL from MySQL and TypeORM.
- Removed migration service and migration table schema.
- Removed the
ApprovedUserandBlacklisttables in the database schema. - Refactored database models and schemas, with changes in primary key annotations and modified data types for tables such as
Group,User,Warning,ApprovedUser,Channel, andGroupRule.
Features:
-
Bot Command Enhancements:
- Implemented an advanced user management and moderation system.
- Added comprehensive admin and chat validation middleware to improve command handling and validation.
- Integrated new admin commands for better bot management.
- Added core utilities for command handling, rate limiting, and bot replies.
- Implemented a registration system for commands using the
GenerateCommandclass. - Added report and cancel commands for user moderation.
- Developed a welcome message management and warnings system for group chats.
-
Database and Services:
- Introduced the
ServiceProviderclass to centralize database access and service management. - Added
DatabaseService,MembersService,TablesService, andGroupRuleServicefor enhanced group management and database operations. - Updated database schema to add
created_atandupdated_atcolumns toUserandGrouptables. - Added a database connection pool and automatic database initialization.
- Refactored database services for improved scalability and performance.
- Introduced the
-
Error Handling:
- Implemented a
Catchdecorator for centralized error handling in asynchronous methods across the application.
- Implemented a
-
Middleware:
- Added middleware to validate group chats and check bot/admin permissions for user and admin commands.
-
Miscellaneous:
- Refined bot service logic and removed unnecessary console logs.
- Removed blacklist.json file and refactored related bot logic.
- Improved handling of user restrictions and blacklisted words.
- Added support for handling Persian and Gregorian dates.
Refactoring:
- Refined the
BotReplyandChatInfoclasses to improve command processing and responses. - Refactored
CopBotto useServiceProviderfor database initialization and added new admin command functionality. - Refined the
Catchdecorator to handle errors in a more structured manner. - Updated
BotMiddlewarefor more granular control over command execution flow.
Bug Fixes:
- Fixed issue with bot command registration and execution flow.
- Removed unused imports and methods, such as
forwardChannelPostToGroup. - Fixed errors related to missing fields in the database schema.
Full Changelog: v3.0.0...v4.0.0