telegram-ops-control-skilllisted
Install: claude install-skill 4ntiDandruff/zero-bloat-skills
# Telegram Ops Control Bot Skill
Architectural pattern for monitoring and controlling workbench machines, edge servers, and homelab nodes directly from a mobile device via interactive Telegram inline keyboard buttons, fortified against API parser crashes and network disconnection loops.
---
## 1. Remote Trigger Buttons & Wake-On-LAN (WOL)
Control remote hardware without requiring an SSH terminal session on a laptop:
```python
import html
import subprocess
from telebot import TeleBot
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
bot = TeleBot("TOKEN_PLACEHOLDER")
def main_menu():
markup = InlineKeyboardMarkup(row_width=2)
markup.add(
InlineKeyboardButton("[⚡] Wake Workbench PC (WOL)", callback_data="wol_pc"),
InlineKeyboardButton("[🔄] Restart DNS Service", callback_data="restart_dns"),
InlineKeyboardButton("[📊] Memory Health Check", callback_data="check_ram"),
InlineKeyboardButton("[🛡️] Cloudflare Tunnel Status", callback_data="check_cf")
)
return markup
@bot.callback_query_handler(func=lambda call: True)
def handle_query(call):
if call.data == "wol_pc":
subprocess.run(["wakeonlan", "AA:BB:CC:DD:EE:FF"], check=True)
bot.answer_callback_query(call.id, "WOL magic packet dispatched.")
elif call.data == "check_ram":
out = subprocess.check_output(["free", "-h"]).decode()
# Enforce HTML escaping to prevent Telegram API 400 Bad Request
safe_out = html.esca