Skip to main content

Telegram Bot Control

Monitoring and process control for existing aiogram bots. One owner, one Windows or Linux server, many bots. Includes an embedded Python SDK, an optional browser dashboard and a separately distributed desktop application.

Install

For an aiogram bot:

python -m pip install "telegram-bot-control[aiogram]"

For the lightweight web dashboard or stdio/SSH reader:

python -m pip install telegram-bot-control

Requires Python 3.11+. The base package depends only on psutil. The wheel includes the web UI and local Latin/Cyrillic fonts; Node.js and Electron are not required for browser mode. Windows setup and Linux AppImage are distributed through GitHub Releases.

Connect your bot

After creating your existing Bot and Dispatcher, add this inside your startup function, before polling:

from telegram_bot_control import start

monitor = start(
    bot=bot,
    dispatcher=dp,
    data_dir="/srv/bot-control/data",  # choose your own absolute directory
)
dp.update.outer_middleware(monitor.middleware())

await dp.start_polling(bot)

Use the same data directory for all connected bots and the dashboard. On Windows, an example is data_dir=r"C:\BotControl\data". Keep your existing handlers, routers, environment loader and polling call. The SDK writes bounded batches to per-bot SQLite WAL files without opening a listening port in the bot.

Start the optional browser dashboard:

tgbots web --port 8765 --data-dir /srv/bot-control/data

The terminal displays a loopback URL and a separate dashboard access key. For network access and Termux, see the web dashboard guide. The default mode is local HTTP; use an HTTPS proxy or SSH tunnel for untrusted networks.

Features

  • Bot status, message/command/button counters and retained error history.
  • Existing Python logging and optional Loguru adapters, search and secret redaction.
  • CPU, RSS and thread history for each bot's Python process.
  • Explicit launch profiles: arguments, working directory, preparation steps and optional env-file.
  • Start, graceful stop, restart and bounded on-failure automatic restarts.
  • Detailed startup stderr/stdout, including failures before SDK initialization.
  • Russian/English interfaces and configurable retention.

Optional integration with an already configured logger:

monitor.capture_logs()  # standard logging; existing handlers are preserved
# For Loguru, use logger.add(monitor.loguru_sink, level="INFO") instead.

This is an early preview for a single trusted owner. Process control verifies PID, creation time and owner. Multiple bots sharing one Python process share resource measurements and cannot be stopped independently. It does not install an OS boot service or import historical log files.

Created by Дмитрий Варг. MIT license.

Source and documentation · Russian walkthrough · Issues

Metadata

Release files for telegram-bot-control 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for telegram-bot-control 0.5.1
File Size Uploaded Provenance Actions
telegram_bot_control-0.5.1.tar.gz 288.2 kB With provenance Details for telegram_bot_control-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for telegram-bot-control 0.5.1
File Interpreter ABI Platform Actions
telegram_bot_control-0.5.1-py3-none-any.whl Python 3 none any Details for telegram_bot_control-0.5.1-py3-none-any.whl

Total release size: 516.8 kB

Release files / telegram_bot_control-0.5.1.tar.gz

Download URL telegram_bot_control-0.5.1.tar.gz
Size 288.2 kB
Tags Source
SHA-256 checksum
How to use checksums
21f00eeb1ff1d605b0ec9d9c1a4397013926bdc21222384f2f36745b553bb2f1
BLAKE2b-256 checksum
How to use checksums
a08e7f0f81726a1930b4995735c7cc8d78d317b98f5b28b1e5e7d0f99ac8d03f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / telegram_bot_control-0.5.1-py3-none-any.whl

Download URL telegram_bot_control-0.5.1-py3-none-any.whl
Size 228.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02ef8339301cc48e3be1e68a8d3eac9df2b063028f22e81755db71e65bbfa5a6
BLAKE2b-256 checksum
How to use checksums
f0867cb031b2b04561c74cadfa5c8f85baa60f703b0427f1657170956eb3ea55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for telegram-bot-control 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for telegram_bot_control-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page