Note: This repository was formerly known as "telegram-bot-get-ip" and has been expanded with comprehensive PC administration features.
A comprehensive Telegram bot for remotely monitoring and controlling your PC from anywhere. Get system information, manage files, take screenshots, and execute system commands - all through Telegram messages.
- Get your system's IP addresses (local and public)
- Retrieve system hostname
- Authorization-based access control
- Real-time Stats: CPU usage, memory usage, disk space
- System Info: Uptime, boot time, OS details
- Process Monitoring: View top processes by CPU usage
- Temperature Sensors: Monitor system temperatures (Linux)
- System Logs: Read and view system event logs
- Power Management: Shutdown, restart, sleep
- Session Control: Lock screen, logout user
- All commands include confirmation prompts for safety
- Screenshot: Capture and receive screenshots remotely
- File Browser: List directory contents
- File Transfer: Upload and download files (up to 50MB)
- Works with both Windows and Linux paths
- Chat ID whitelist - only authorized users can control the bot
- Confirmation prompts for destructive operations
- Secure file access within system permissions
git clone https://github.com/hmarsolla/telegram-bot-get-ip.git
cd telegram-bot-get-ip
pip install -r requirements.txt- Create a Telegram bot via @BotFather and get your bot token
- Get your Chat ID by messaging the bot and using
/getid - Copy the example environment file and configure it:
cp .env.example .env- Edit
.envand add your credentials:
# Telegram Bot API Token (from @BotFather)
TELEGRAM_BOT_TOKEN=your_bot_token_here
# Authorized Chat IDs (comma-separated)
AUTHORIZED_CHAT_IDS=your_chat_id_here,additional_id_hereSecurity Note: The .env file is automatically ignored by git to protect your credentials.
python main.py/start- Initialize the bot/helpor/commands- Show all available commands/getid- Get your Telegram chat ID/where- Get hostname, local IPs, and public IP
/uptime- System uptime and boot time/disk- Disk usage for all partitions/memory- RAM and swap memory statistics/cpu- CPU usage and frequency information/processes- Top 10 processes by CPU usage/temp- System temperature sensors (Linux only)
/shutdown- Shut down the system/restart- Restart the system/sleep- Put system to sleep/suspend/lock- Lock the screen/logout- Log out current user
/screenshot- Capture and send a screenshot/ls [path]- List files in a directory/download <file_path>- Download a file from PC- Send a file with caption
/upload [path]- Upload file to PC
/status- Comprehensive system status overview/log [lines]- View system logs (default 50, max 200)
Note: Use /cancel to exit any confirmation prompt.
docker build -t telegram-pc-admin-bot .docker run -v /path/to/your/.env:/app/.env telegram-pc-admin-botNote: Docker deployment has limitations with system control commands (shutdown, restart, etc.) as they affect the host system.
| Feature | Windows | Linux | Notes |
|---|---|---|---|
| Basic Commands | β | β | Fully compatible |
| System Information | β | β | All commands work |
| Temperature Monitoring | β | β | Requires lm-sensors on Linux |
| System Control | β | β | May require sudo on Linux |
| Screenshots | β | β | Requires graphical environment |
| File Operations | β | β | Cross-platform paths |
| Log Viewing | β | β | Event Log (Win) / syslog (Linux) |
- Python 3.14+
- python-telegram-bot 21.7
- psutil 6.1.1
- mss 10.0.0
- requests 2.32.3
All dependencies are listed in requirements.txt
Configure passwordless sudo for specific commands:
sudo visudoAdd these lines (replace username with your username):
username ALL=(ALL) NOPASSWD: /sbin/shutdown
username ALL=(ALL) NOPASSWD: /sbin/reboot
sudo apt-get install lm-sensors
sudo sensors-detectRequires a graphical environment (X11 or Wayland with compatibility mode).
- commands.md - Detailed command reference with examples
- PLATFORM_COMPATIBILITY.md - Cross-platform compatibility guide
Contributions are welcome! Feel free to:
- Add new commands
- Improve existing functionality
- Fix bugs
- Improve documentation
- Keep your bot token secret - Never commit it to version control
- Whitelist trusted users only - Use the CHATIDLIST in config.py
- Be cautious with system control - Commands like shutdown can disrupt operations
- File access permissions - Bot has access to all files the user can read/write
- Run with appropriate privileges - Some commands require admin/sudo access
[Add your license here]
Built with:
Last Updated: October 26, 2025
Python Version: 3.14+
Bot Version: 2.0