Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help others learn and grow
- Check existing issues - Make sure the bug hasn't been reported
- Provide details - Include:
- Python version
- Telethon version
- Bot version
- Steps to reproduce
- Expected vs actual behavior
- Error messages/logs
- Use the bug template - Click "New Issue" and select the bug template
- Check existing issues - Avoid duplicates
- Describe the feature - Explain:
- What problem it solves
- How it should work
- Example use cases
- Discuss alternatives - Show you've thought about the design
-
Fork the repository
git clone https://github.com/yourusername/telegram-keyword-search-bot.git cd telegram-keyword-search-bot -
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow PEP 8 style guide
- Add docstrings to functions
- Add type hints where possible
- Test your changes thoroughly
- Update relevant documentation
-
Commit with clear messages
git commit -m "feat: add feature description" git commit -m "fix: resolve issue #123" git commit -m "docs: update README"
-
Push and create a Pull Request
git push origin feature/your-feature-name
- Python: Follow PEP 8
- Formatting: Use consistent indentation (4 spaces)
- Naming: Use descriptive names for variables, functions, classes
- Comments: Explain the "why", not the "what"
- Type Hints: Add type hints for better code clarity
- Docstrings: Use Google-style docstrings for all functions
async def search_messages(
client: TelegramClient,
keywords: List[str],
start_date: datetime,
end_date: datetime,
) -> List[Tuple[Any, Any]]:
"""
Search for keywords in user's chats.
Args:
client: Telegram client instance
keywords: List of keywords to search for
start_date: Search start date (UTC)
end_date: Search end date (UTC)
Returns:
List of (dialog, message) tuples matching the search
Raises:
ValueError: If date range is invalid
"""
# Implementation- Test your changes locally before submitting
- Include test cases for new features
- Verify existing functionality still works
- Test with multiple scenarios if possible
-
Title: Use clear, descriptive titles
fix: handle null messages in searchfeat: add export to file functionalitydocs: improve setup instructions
-
Description: Include:
- What changed and why
- Related issue numbers (e.g.,
Closes #123) - Testing steps
- Any breaking changes
-
Checklist:
- [ ] Code follows style guidelines - [ ] Docstrings added/updated - [ ] Tests added/updated - [ ] Documentation updated - [ ] No new warnings generated
# Create virtual environment
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
# Install dependencies
pip install -r requirements.txt
# Install development tools (optional)
pip install pytest black flake8
# Run the bot
python main.py├── main.py # Bot logic and command handlers
├── session_manager.py # User session management
├── searcher.py # Search functionality
├── requirements.txt # Python dependencies
├── README.md # User documentation
├── CONTRIBUTING.md # This file
├── CHANGELOG.md # Version history
└── bot.log # Generated by the bot
- Bug fixes
- Documentation improvements
- Error handling enhancements
- Performance optimizations
- Security improvements
- Advanced search filters
- Search history database
- Export results functionality
- Bulk operations
- Web dashboard
- Check existing issues and discussions
- Read the documentation in README.md
- Create a new discussion for questions
Contributors will be:
- Listed in the README.md
- Acknowledged in CHANGELOG.md
- Credited in GitHub commits
Thank you for contributing! 🎉