How ksanicc/pc_bot works
This is a Telegram bot for remotely controlling a Windows or Linux PC. An administrator sends commands through Telegram; the bot routes them to admin handlers, which report system status, launch shell commands, reboot, or on Linux set the next Windows boot entry and reboot. A separate user handler rejects non-admin starts. Configuration supplies credentials, proxy, shell, and boot order. The README also describes optional service installation, but that is setup machinery rather than the bot’s runtime workflow. Relationships below follow the sampled entry point and handlers.
Main entry points: admin.py Admin commands · main.py Polling entry point · user.py Non-admin response · config.py Bot configuration
Components 10
Bot runtime
- Polling entry point
main.py
Command handling
- Admin commands
handlers/admin.py - Non-admin response
handlers/user.py
Host operations
- Shell execution
handlers/admin.py - System status
handlers/admin.py - PC reboot
handlers/admin.py - Windows boot switch
handlers/admin.py
Configuration
- Bot configuration
config.py
Other components
- Administrator
- Telegram API
Connections 15
- Administrator → Telegram API: sends commands
README.md - Telegram API → Polling entry point: delivers updates
main.py - Polling entry point → Bot configuration: reads settings
main.py - Polling entry point → Admin commands: registers router
main.py - Polling entry point → Non-admin response: registers router
main.py - Admin commands → Bot configuration: reads settings
handlers/admin.py - Admin commands → Shell execution: executes command
handlers/admin.py - Admin commands → System status: runs metrics command
handlers/admin.py - Admin commands → PC reboot: dispatches reboot
handlers/admin.py - Admin commands → Windows boot switch: sets boot entry
handlers/admin.py - Shell execution → Telegram API: replies with output
handlers/admin.py - System status → Telegram API: replies with metrics
handlers/admin.py - PC reboot → Telegram API: sends notice
handlers/admin.py - Windows boot switch → PC reboot: reboots after setup
handlers/admin.py - Non-admin response → Telegram API: replies to user
handlers/user.py