1.5 KiB
1.5 KiB
Discord Data Collector - Agent Guide
Commands
- Setup:
python setup.py- Install dependencies and create config files - Run Main:
python main.py- Start Discord data collector - CLI Tools:
python cli.py [command]- Available: export, stats, search, backup, cleanup, test - Test Imports:
python test_imports.py- Verify all dependencies work - Install Dependencies:
pip install -r requirements.txt
Architecture
- Entry Points:
main.py(main app),cli.py(CLI tools),setup.py(installation) - Core Modules:
src/client.py- Discord client implementation with data collectionsrc/database.py- MariaDB database manager with UserData dataclasssrc/config.py- TOML/env configuration managementsrc/rate_limiter.py- API rate limitingsrc/logger.py- Logging setup
- Data Storage: JSON files in
data/directory, backups indata/backups/ - Configuration:
config.tomlfor app settings,.envfor Discord token
Code Style
- Python: 3.8+ required, async/await patterns throughout
- Imports: Standard library first, third-party, then local (
from .module import Class) - Error Handling: Comprehensive try/catch with logging, graceful degradation
- Naming: snake_case for variables/functions, PascalCase for classes
- Types: Type hints required (
typingmodule), dataclasses for data structures - Async: All I/O operations use async/await, proper cleanup in finally blocks