How sanjit-sinha/telegrambot-boilerplate works
Project Type and Core Architecture
a. Main Components:
• Telegram API Interface
• Bot Core System
• MongoDB Database
• Plugin System
• Helper Services
Key Architectural Elements
a. External Services Layer:
• Telegram MTProto API
• MongoDB Database
• External Services (paste services, speedtest)
b. Core Bot Layer:
• Main Bot Instance (TelegramBot/__init__.py, __main__.py)
• Configuration Management (config.py)
• Logging System (logging.py)
c. Plugin System (Three-tier):
• User Plugins
• Sudo Plugins
• Developer Plugins
d. Helper Layer:
• Rate Limiter
• Decorators
• Filters
• Utility Functions
[External Services Layer]
• ↕
[Core Bot Layer]
• ↕
[Plugin Management Layer]
• ↕
[Helper Services Layer]
• ↕
[Database Layer]
Component Relationships to Highlight
a. Data Flow:
• User → Telegram API → Bot Core → Plugins → Database
• Plugin → Helper Services → External Services
• Rate Limiter → Plugin Execution
b. Dependencies:
• Plugin System ← Helper Services
• Bot Core ← Configuration
• All Components ← Logging System
Specific Implementation Details
[Telegram MTProto API] ←→ [Bot Core]
• ↑ ↓
• [Rate Limiter] [Configuration]
• ↑ ↓
[Plugin System] ←→ [Helper Services]
• ↓ ↓
• [Database] ←→ [External Services]
Additional Elements
Specific features:
• Asynchronous operation indicators
• Rate limiting flow
• Plugin hierarchy (Users/Sudo/Developer)
• MongoDB CRUD operations
• Error handling and logging paths
Implementation Notes
• Version information (from version.py)
• Configuration flow from config.env