A sophisticated Python-based bot that parses Telegram channels and RSS feeds, processes the content, and reposts it to specified channels with image processing capabilities.
-
Multi-Source Parsing
- Telegram Channel Parsing
- RSS Feed Parsing
- Supports multiple channels and feeds simultaneously
-
Content Processing
- Text content filtering with keywords
- Bad words filtering
- Image processing and storage
- Link handling and formatting
-
Flexible Posting
- Customizable posting schedule
- Multiple target channels support
- Markdown formatting support
- Media group handling
-
Administrative Interface
- Channel management
- Source management
- Keyword management
- Settings management
The project consists of several main components:
main.py- Main bot initialization and routing- Handlers for different functionalities:
- Channel management
- Source management
- Settings management
- Keyword management
- Telegram channel parser
- RSS feed parser
- Content extraction and processing
- MongoDB integration
- MinIO for file storage
- Configuration management
- Channel and source management
- Comprehensive logging
- Error tracking
- Activity monitoring
- Python 3.12+
- MongoDB
- MinIO
- Docker (optional)
- Clone the repository:
git clone https://github.com/yourusername/python-bot-parser.git
cd python-bot-parser- Create and activate virtual environment:
python -m venv bot/bot-venv
source bot/bot-venv/bin/activate # Linux/Mac
# or
bot\bot-venv\Scripts\activate # Windows- Install dependencies:
cd bot
pip install -r requirements.txt- Configure environment variables:
Create a .env file in the bot directory with:
BOT_TOKEN=your_telegram_bot_token
API_ID=your_telegram_api_id
API_HASH=your_telegram_api_hash
ADMIN_CHAT_ID=your_admin_chat_idThe bot uses MongoDB for data storage. Configure your MongoDB connection in data/base_connection_db.py.
MinIO is used for file storage. Configure MinIO settings in data/minio_function.py.
- Channel management interface
- Source management interface
- Settings configuration panel
- Parser settings
- Filter configuration
- Schedule management
- Using Python directly:
cd bot
python telegram_bot/main.py- Using Docker:
docker-compose up -d/start- Initialize bot- Settings management through inline buttons
- Channel management through menu interface
- Source configuration through dedicated panels
- Configurable parsing intervals
- Content filtering based on keywords
- Bad word filtering
- Image processing and optimization
- Link extraction and formatting
- Scheduled posting
- Multiple channel support
- Media group handling
- Markdown formatting
- Custom templates
- Channel management
- Add/remove channels
- Configure parsing settings
- Set posting rules
- Source management
- Add/remove sources
- Configure parsing rules
- Set update intervals
- Keyword management
- Add/remove keywords
- Configure filters
- Set up bad word lists
- Settings management
- Configure global settings
- Set up parsing intervals
- Manage bot behavior
Contributions are welcome! Please feel free to submit a Pull Request.
