Skip to content

Commit acb4470

Browse files
committed
updated readme
1 parent f2f9b1b commit acb4470

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A professional Telegram bot for executing code snippets in multiple programming
99
- **Professional Architecture**: Modular, maintainable code structure
1010
- **Error Handling**: Comprehensive error handling and retry mechanisms
1111
- **Rate Limiting**: Built-in rate limiting to prevent abuse
12+
- **Channel Membership**: Optional requirement for users to join a specific channel
1213
- **Health Monitoring**: Automatic health checks and resource management
1314
- **Docker Support**: Containerized deployment with health checks
1415
- **Graceful Shutdown**: Proper cleanup on termination
@@ -110,6 +111,27 @@ iRunCode/
110111
docker-compose down
111112
```
112113

114+
## Configuration
115+
116+
### Channel Membership Requirements
117+
118+
The bot supports optional channel membership requirements to encourage users to join your channel before using the bot:
119+
120+
1. **Enable the feature** by setting `REQUIRE_CHANNEL_MEMBERSHIP=true` in your `.env` file
121+
2. **Set the channel** using `REQUIRED_CHANNEL_ID` with either:
122+
- Public channel: `@your_channel_username`
123+
- Private channel: `-1234567890123` (channel ID)
124+
125+
When enabled, users who aren't members of the specified channel will receive a message prompting them to join before they can use the bot's features.
126+
127+
### Getting Channel ID for Private Channels
128+
129+
For private channels, you need the channel ID:
130+
131+
1. Add your bot as an admin to the channel
132+
2. Forward a message from the channel to @userinfobot
133+
3. Use the channel ID (negative number) in your configuration
134+
113135
## Environment Variables
114136

115137
Create a `.env` file in the root directory with the following variables:
@@ -132,6 +154,10 @@ RATE_LIMIT_WINDOW=60
132154
RATE_LIMIT_MAX_REQUESTS=10
133155
HEALTH_CHECK_INTERVAL=300
134156
MAX_MEMORY_USAGE=256
157+
158+
# Channel Membership Requirements (Optional)
159+
REQUIRE_CHANNEL_MEMBERSHIP=false
160+
REQUIRED_CHANNEL_ID=@area51_blog
135161
```
136162

137163
## Usage
@@ -183,6 +209,13 @@ Python, C++, C#, JavaScript, Java, Go, Rust, PHP, C, Bash, and 40+ more language
183209
4. **Type Hints**: Full type annotations for better code quality
184210
5. **Async/Await**: Proper asynchronous programming throughout
185211
6. **Docker Support**: Production-ready containerization
212+
7. **Channel Integration**: Optional channel membership requirements
213+
214+
### User Management Features
215+
216+
1. **Channel Membership**: Configurable requirement for users to join a specific channel before using the bot
217+
2. **Automatic Verification**: The bot automatically checks if users are members of the required channel
218+
3. **Flexible Configuration**: Can be enabled/disabled and configured for any public or private channel
186219

187220
### Performance Enhancements
188221

0 commit comments

Comments
 (0)