Thanks for your interest in LeechBot! This guide explains how to contribute effectively.
- Python 3.10+
- Git
- A Telegram bot token (for testing)
- System deps:
ffmpeg,aria2,p7zip-full
git clone https://github.com/Shineii86/LeechBot.git
cd LeechBot
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your credentials
python3 -m leechbotgit checkout -b feature/my-feature- Follow existing code patterns (see
AGENTS.mdfor conventions) - Keep changes focused — one feature/fix per PR
- Test manually with the bot
Every change must be recorded:
## [X.Y.Z] - YYYY-MM-DD
### Added
- New feature description
### Fixed
- Bug fix descriptionAdd new entries at the top. Never edit or delete existing entries.
git add -A
git commit -m "feat: description" # or "fix:", "docs:", "refactor:"Use Conventional Commits:
feat:— new featurefix:— bug fixdocs:— documentation onlyrefactor:— code restructuringchore:— maintenance tasks
git push origin feature/my-featureOpen a Pull Request against main.
- Linter: ruff (configured in
pyproject.toml) — follow existing patterns - Async/await everywhere (this is an asyncio app)
logger = logging.getLogger(__name__)at module top- Type hints on function signatures preferred
- Docstrings on public functions
Every new .py file must have the standard header:
# =============================================================================
# Telegram Leech Bot - [Module Name]
# =============================================================================
# Project : LeechBot
# Developer : Shinei Nouzen
# GitHub : https://github.com/Shineii86
# Telegram : https://telegram.me/Shineii86
# =============================================================================
# License : MIT License
# =============================================================================- Global state goes in
leechbot/utility/variables.py - Import existing classes, don't create new state singletons
- Mutate class attributes directly
- Wrap risky operations in try/except
- Log errors with
logger.error() - FloodWait:
await sleep(e.value + 1)+ retry (max 10 times) - Don't silently swallow exceptions
- Add more downloader adapters (new file hosting sites)
- Improve error messages for users
- Expand test suite (
tests/) with more coverage - Dashboard improvements (new features, better UX)
- Documentation improvements
| Area | Status | Notes |
|---|---|---|
| Unit tests | tests/test_diagnostics.py exists — expand coverage |
|
| CI/CD | ❌ None | GitHub Actions would be great |
| Type hints | Some files have them, many don't | |
| i18n | ❌ None | English only |
| Docker | ✅ Done | Dockerfile + docker-compose.yml with all deps |
| Web dashboard | ✅ Basic | Could add more controls |
Before submitting:
- Code follows existing patterns
- CHANGELOG.md updated (new entry at top)
- Manual testing done
- No secrets committed (
.env, tokens, etc.) - Commit messages use conventional format
- PR description explains what and why
Use GitHub Issues with:
- Clear title
- Steps to reproduce
- Expected vs actual behavior
- Bot logs (check DUMP channel)
- Python version, OS, deployment method (VPS/Colab)
By contributing, you agree your code will be licensed under the MIT License.