Skip to content

Releases: CodeModule-ir/cop

[4.0.1] - 2024-11-18

18 Nov 12:13
abe401d
Compare
Choose a tag to compare

[4.0.1] - 2024-11-18

Bug Fixes:

  • Fixed formatting issues in the ChatInfo class for admin list display.
  • Resolved database path selection bugs in Tables.ts.
  • Removed redundant scripts and simplified CopBot initialization logic.
  • Corrected error handling and shutdown processes in app.ts.

Refactoring:

  • Removed middleware in favor of Catch decorators for cleaner code structure.
  • Refined error handling for webhook creation and bot start methods.

Full Changelog: v4.0.0...v4.0.1

[4.0.0] - 2024-11-17

17 Nov 02:44
569dfd8
Compare
Choose a tag to compare

[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

3.0.0

10 Aug 17:10
Compare
Choose a tag to compare

[3.0.0] - 2024-08-10

Added

  • Features:
    • aran: New command with a multi-step process:
      1. "Aran mode: Activated"
      2. "رفرنس بده."
      3. "Aran mode: DeActivated"
    • codeTime: New command that provides sarcastic and insulting messages encouraging users to code or telling everyone to code if not replying to anyone.
    • GroupSettings: Added isSpamTime to show a message during spam time: "بوی اسپم تایم میاد 😋".
    • Pv Robot: Added a new message for commands sent to the Pv Robot.

Fixed

  • Bug Fixes:
    • warn: Fixed issues related to warning functionalities.
    • approved: Fixed the bug related to the approved command.
    • unApproved: Fixed the bug where users were not removed from the approved list as expected.
    • approvedList: Fixed bugs related to the approvedList command.
    • /date: Fixed the bug where the Persian days were not displayed correctly.

Removed

  • Database Changes:
    • Removed the groupMembership table and its associated code.

Refactored

  • Code Updates:
    • GroupSettings: Updated to include new fields and methods related to spam time and other settings.
    • service/db/user: Updated methods to use dynamic telegramId and fixed various issues.
    • service/command: Added and updated methods for new commands; cleaned up unnecessary logging.
    • middleware: Removed unnecessary logger imports and updated methods.
    • entities: Updated User, GroupSettings, and Warning entities; removed GroupMembership entity.
    • command: Refactored commands to include new functionalities and clean up logic.

Known Issues

  • Some bugs related to deprecated functionalities may still persist but are being actively addressed.

Future Plans

  • Continue improving bot functionalities based on user feedback and addressing remaining bugs.

License

  • This project is licensed under the MIT License.

Full Changelog: v2.0.0...v3.0.0

fix bugs

07 Aug 01:55
Compare
Choose a tag to compare

[2.0.0] - 2024-08-07

Added

  • Features:
    • approvedList: Returns the list of approved users.
    • RATE LIMIT: Introduced rate limiting for commands to prevent abuse.
    • Decorator Group Initial: Added a decorator for initializing the group in case of database deletion, ensuring normal operation.

Fixed

  • Bug Fixes:
    • rmWarn: Fixed the bug that prevented warnings from being removed correctly.
    • unApproved: Fixed the bug where users were not removed from the approved list as expected.
    • rules: Fixed the bug where adding a new rule caused the previous rules to be deleted.
    • purge: Fixed the bug that limited message deletion to fewer than 200 messages; now supports deleting more messages in a short time.

Enhancements

  • Logging:
    • Added loggers to improve the ability to analyze program behavior and track issues.

Contribution

  • Contributions are welcome. Please follow the guidelines provided in the CONTRIBUTING.md file for more details on how to contribute.

License

  • This project is licensed under the MIT License.

Full Changelog: v1.0.0...v2.0.0