Skip to content

[4.0.0] - 2024-11-17

Choose a tag to compare

@m-mdy-m m-mdy-m released this 17 Nov 02:44
· 370 commits to main since this release
569dfd8

[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 ApprovedUser and Blacklist tables 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, and GroupRule.

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 GenerateCommand class.
    • Added report and cancel commands for user moderation.
    • Developed a welcome message management and warnings system for group chats.
  • Database and Services:

    • Introduced the ServiceProvider class to centralize database access and service management.
    • Added DatabaseService, MembersService, TablesService, and GroupRuleService for enhanced group management and database operations.
    • Updated database schema to add created_at and updated_at columns to User and Group tables.
    • Added a database connection pool and automatic database initialization.
    • Refactored database services for improved scalability and performance.
  • Error Handling:

    • Implemented a Catch decorator for centralized error handling in asynchronous methods across the application.
  • 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 BotReply and ChatInfo classes to improve command processing and responses.
  • Refactored CopBot to use ServiceProvider for database initialization and added new admin command functionality.
  • Refined the Catch decorator to handle errors in a more structured manner.
  • Updated BotMiddleware for 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