Mopera is a Telegram administration bot for Marzban and Marzneshin panels. It provides user, administrator, template, server, statistics, bulk-operation, QR-code, node-monitoring, and expiry-report workflows through Telegram.
Both sudo and regular panel accounts are supported. Available menus and actions follow the permissions granted by the connected panel. Panel URLs may include a reverse-proxy or dashboard path; omitted ports default to 443 for HTTPS and 80 for HTTP.
- PHP 8.1 or newer
- cURL and
CURLStringFile - PDO MySQL
- JSON, ctype, and zlib extensions
- GD only when QR backgrounds are enabled
- MySQL or MariaDB with permission to create and alter tables
- Copy
config.sample.phptoconfig.php. - Configure the Telegram token, administrator IDs, webhook URL, timezone, and MySQL connection.
- Point the Telegram webhook to
index.phpover HTTPS. - Run the worker once per minute:
* * * * * /usr/bin/php /absolute/path/mopera/cron.phpA supervised process may run php cron.php --daemon instead. Use only one worker mode; MySQL advisory locks prevent overlapping runs.
Long panel scans and bulk changes use a persistent MySQL queue. Smaller operations run immediately. Statistics scan independent pages concurrently and checkpoint fetched data, while mutation jobs store intent and before-state evidence for recovery.
Useful commands:
php queue.php health
php queue.php attention
php queue.php inspect JOB_ID
php queue.php issues JOB_ID
php queue.php reconcile JOB_ID
php queue.php cancel JOB_IDThe Telegram /jobs command lists recent jobs for the current chat. Runtime state, caches, server records, templates, queue jobs, and recovery data remain in MySQL.
Queue and scan behavior can be adjusted in config.php:
'queue_budget_seconds' => 55,
'queue_cron_budget_seconds' => 300,
'scan_page_size' => 1000,
'scan_request_timeout_seconds' => 25,
'scan_parallel_requests' => 4,
'queue_retention_days' => 7,
'inline_lease_seconds' => 120,Keep config.php outside version control because it contains Telegram and database credentials.
Releases are created from version tags. Update MOPERA_VERSION in version.php, commit the change, then push the matching tag:
git tag -a v1.1.0 -m "Mopera v1.1.0"
git push origin main v1.1.0GitHub Actions verifies the version, creates a clean ZIP archive and checksum, and publishes them in the corresponding GitHub Release.