How mrmkn/professor-bot works
Main Components
• Bot Entry Point: Highlight bot.py (and possibly Script.py if used for initialization) as the central file that triggers the bot’s operation.
• Database Layer: Use the “database” folder and its files (e.g., connections_mdb.py, filters_mdb.py, gfilters_mdb.py, ia_filterdb.py, users_chats_db.py) to represent the data persistence and interactions (primarily with mongoDB, as seen in the environment variables).
• Plugins System: Represent the entire “plugins” directory as a modular collection, subdividing into:
• Core files (admin_control.py, banned.py, broadcast.py, commands.py, connection.py, file_store.py, filters_global.py, group_filter.py, index.py, inline.py, pm_filter.py, query.py)
• Extra modifications/extended features in the “plugins/ExtraMods” directory (e.g., carbon.py, font.py, group_manager.py, json.py, lyrics.py, password.py, paste.py, photo.py, share_text.py, telegraph.py, tts.py, yt_dl.py)
• Image Editing: Include the “image” folder, which contains several scripts (edit_1.py through edit_5.py and font_string.py) for image edits or background removal.
• Supporting Utilities & Configuration: Consider files like utils.py, logging.conf, info.py, and configuration files (Dockerfile, Procfile, runtime.txt, app.json) that determine deployment and runtime behavior.
Establish Relationships & Interactions
• The Main Bot (from bot.py) acts as the orchestrator – it receives Telegram updates and directs them to the Plugin Manager.
• The Plugins: Each plugin file (and ExtraMods plugins) represents a specialized command or functionality module. They interact directly with the bot entry point to process commands and can depend on the utilities in utils.py.
• Image Processing: Specific commands invoke image processing functions (via scripts in the “image” folder). Connect these to the plugin modules related to image editing.
Indicating Architectural Patterns & Technologies
• File-based Modular Design: Emphasize that the system uses individual files organized by functionalities – each file in a directory represents a distinct module.
• Decoupled Plugin Architecture: The plugins directory shows that functionality is divided into granular plugins that can be loaded, updated, or extended independently.
• Database Abstraction: The separate “database” folder indicates that data access is abstracted away from the core business logic.
• Deployment Configuration Files: These allow the bot to be containerized (Dockerfile) and deployed to platforms like Heroku or Koyeb (Procfile, runtime.txt, etc.).
• Underlying Technologies: Mention that the project likely uses Python (given the .py files and naming conventions), integrates with Telegram API (as described in the README with required tokens and API parameters), and uses MongoDB.
Essential Elements
• Clear, descriptive labels that mention both the component and, where appropriate, the key file names.
• Separation of concerns: visually represent the physical separation between main logic (bot.py), plugins (commands, etc.), and the supporting database and image utilities.
• That it’s easy to see where each functional area is located within the file system, thereby making maintenance or future extensions clear.
• To indicate the file-based structure: each node representing a folder might include a sub-listing of critical files.