Code Module Cop is a powerful and flexible group management bot for Telegram and a dedicated CodeModule bot designed to help admins manage and moderate their groups effectively. This bot offers various features including welcome messages, role management, auto replies, and more.
- Moderation Tools: Mute and ban users with automated handling of warnings.
- Welcome Messages: Custom welcome messages for new members.
- Role Management: Manage roles for admins, moderators, and members.
- Logging and Analytics: Track group activity and generate reports.
- Node.js (v20.x or higher)
- npm (v6.x or higher)
-
Clone the repository:
git clone https://github.com/CodeModule-ir/cop.git cd cmcop -
Install dependencies:
npm install
-
Set Up Environment Variables
The bot requires specific environment variables to run correctly. These are stored in a
.envfile in the root directory of your project. This file should not be committed to version control, so ensure it is listed in your.gitignore.Create a
.envfile in the root of your project directory with the following content:```envTELEGRAM_BOT_TOKEN=your_bot_token DB_USER= DB_HOST= DB_NAME= DB_PASSWORD= DB_PORT= DB_URL=postgres://username:password@host:port/database_name DATABASE_URL='' // for production
-
Start the Bot
With the environment variables set, you can start the bot:
```bash npm start ```For detailed installation instructions, see the INSTALLATION.md file.
- /start: Start interacting with the bot and receive a welcome message.
- /help: Get assistance and see the list of available commands.
- /warn [reason]: Issue a warning to a user. If a user accumulates three warnings, they will be automatically banned.
- /mute [time]: Mute a user for a specified duration. Time can be specified in minutes (m), hours (h), or indefinitely.
- /ban: Ban a user from the group permanently.
For detailed usage instructions, see the USAGE.md file.
To mute a user for 10 minutes, use:
/mute 10m (You must reply to the user.)
Read the Contributing Guidelines: Before you start, please read our CONTRIBUTING.md file. It contains important information about how to contribute, including coding standards, how to set up your development environment, and the process for submitting changes.
This project is licensed under the MIT License. See the LICENSE file for details.