middleware.py dependency imports, system utility functions, runtime scheduled commands, and group management methods. Public plugins should prefer the functions listed here and avoid relying on unpublished internal actions.
import_module(module, package="", version="", manager="")
Ensure a Python dependency is available, then return the imported module object.
str
required
Module name passed to
importlib.import_module(...).str
Real package name. Use it when the package name differs from the import name, such as importing
PIL.Image from the pillow package.str
Required version.
str
Package manager name. Python dependencies usually use
pip; omit it to let the runtime infer the manager.importModule = import_module as a compatibility alias. New Python plugins should use import_module(...).
System and utility functions
Cron
Cron manages runtime scheduled commands. It is different from manifest cron: manifest cron triggers the current plugin, while the Cron class adds, updates, lists, and deletes runtime scheduled commands.
Current Python
addCron(...) / updateCron(...) do not require every positional parameter. The method omits fields whose value is None. To clear a field, pass an empty string "".Group management
These methods depend on current IM adapter support. Unsupported adapters may return errors or have no effect. They return the runtimedata value directly.
Next steps
- Push from scheduled tasks:
Proactive push - View complete signatures:
Python signatures