Bot structure
Last updated
Last updated
The bot is based on the pyrogram framework, the documentation for which you can read .
The most important component of the bot is the ModuleLoader
class, which loads and manages modules, installs, updates and uninstalls them, as well as distributes other commands between modules. At startup, the modules
directory in the root of the source code is scanned and all modules are loaded sequentially from there. Module loading takes place in 2 stages:
Stage1 - Read module information, install/update Python packages, provide access to various components (more on this later)
Stage2 - Registration of event handlers
Base extensions - BaseExtension
classes - allow you to influence the standard behavior when loading modules. They are loaded at bot startup like modules, and allow you to make any changes to the module object between stages 1 and 2.