Releases: CodeModule-ir/cop
Releases · CodeModule-ir/cop
[4.0.1] - 2024-11-18
[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
[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
andBlacklist
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
, 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
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
, andGroupRuleService
for enhanced group management and database operations. - Updated database schema to add
created_at
andupdated_at
columns toUser
andGroup
tables. - Added a database connection pool and automatic database initialization.
- Refactored database services for improved scalability and performance.
- Introduced the
-
Error Handling:
- Implemented a
Catch
decorator 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
BotReply
andChatInfo
classes to improve command processing and responses. - Refactored
CopBot
to useServiceProvider
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
[3.0.0] - 2024-08-10
Added
- Features:
aran
: New command with a multi-step process:- "Aran mode: Activated"
- "رفرنس بده."
- "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
: AddedisSpamTime
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 theapproved
command.unApproved
: Fixed the bug where users were not removed from the approved list as expected.approvedList
: Fixed bugs related to theapprovedList
command./date
: Fixed the bug where the Persian days were not displayed correctly.
Removed
- Database Changes:
- Removed the
groupMembership
table and its associated code.
- Removed the
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 dynamictelegramId
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
: UpdatedUser
,GroupSettings
, andWarning
entities; removedGroupMembership
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
[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