A simple Telegram bot written in Rust that sends Wake-On-Lan (WOL) magic packets to wake up devices in your network.
- WOL over Telegram: Trigger magic packets from anywhere using a simple
/wolcommand. - Per-Chat Configuration: Configure different MAC and IP addresses for different Telegram chats.
- Easy Setup: Minimal configuration using environment variables.
- A Telegram Bot Token (from @BotFather).
- Rust (2024 edition or later).
- The target device must be configured to wake up on magic packets (WOL enabled in BIOS/UEFI and OS settings).
The bot is configured via environment variables.
| Variable | Description | Example |
|---|---|---|
TELOXIDE_TOKEN |
Your Telegram Bot API token. | 123456789:ABCdefGHIjklMNOpqrsTUVwxyZ |
CHAT<id> |
Per-chat MAC address of target device. | CHAT123456789=00:11:22:33:44:55 |
LOG_LEVEL |
Logging level (debug, info, warn, error). |
info |
WITHOUT_ANSI_COLOR |
Disable ANSI colors in logs if set. | 1 |
If your Telegram Chat ID is 123456789, you would set:
CHAT123456789=00:11:22:33:44:55
You can specify configuration for multiple chats.
- Clone the repository.
- Set the environment variables.
- Run the bot using Cargo:
cargo run --releaseOnce the bot is running, you can use the following commands in Telegram:
/help- Displays the available commands./wol- Sends the magic packet to the device configured for the current chat.
- You have a PC at home with MAC address
00:11:22:33:44:55. - You find your Telegram Chat ID (e.g., by using a bot like
@userinfobot). - You configure the environment:
TELOXIDE_TOKEN=your_token_here CHAT123456789=00:11:22:33:44:55
- You start the bot.
- In your Telegram chat, you type
/wol. - The bot sends the magic packet and replies:
WOL packet sent to 00:11:22:33:44:55.