How hongphong214365/agentstelegram works
agentsTelegram is an admin-controlled Telegram bot for running local Python files and returning their output or errors. The main workflow is Telegram command → registered handler → validated execution request → subprocess → Telegram reply. Separate commands provide help, ping, status, and recent logs. The README documents these capabilities; sampled source confirms their wiring and the execution/logging details shown below.
Main entry points: __init__.py Handler registration · run.py Run command · main.py Bot startup · log.py Logging and reads
Components 14
Bot runtime
- Bot startup
main.py - Handler registration
handlers/__init__.py - Runtime config
config.py
Command handlers
- Start command
handlers/start.py - Ping command
handlers/ping.py - Run command
handlers/run.py - Status command
handlers/status.py - Log command
handlers/log.py
Execution and logs
- Python runner
runner.py - Logging and reads
log.py - Log file
temp
Other components
- Telegram admin
- Telegram API
- Local Python file
Connections 25
- Bot startup → Runtime config: loads settings
- Bot startup → Handler registration: registers handlers
- Bot startup → Telegram API: polls updates
- Telegram API → Bot startup: delivers updates
- Handler registration → Start command: registers
- Handler registration → Ping command: registers
- Handler registration → Run command: registers
- Handler registration → Status command: registers
- Handler registration → Log command: registers
- Telegram admin → Telegram API: sends commands
- Start command → Runtime config: checks admin
- Start command → Telegram API: replies with help
- Ping command → Telegram API: replies online
- Run command → Runtime config: checks settings
- Run command → Local Python file: checks file
- Run command → Python runner: runs file
- Python runner → Local Python file: executes
- Python runner → Logging and reads: logs errors
- Run command → Telegram API: replies with output
- Status command → Runtime config: reads settings
- Status command → Telegram API: replies with status
- Log command → Logging and reads: gets recent logs
- Logging and reads → Log file: reads and writes
- Log command → Telegram API: replies with logs
- Bot startup → Logging and reads: logs startup