Files
vps-management-bot/scripts/fix-telegram-menu.sh

16 lines
739 B
Bash
Raw Normal View History

2026-03-21 01:10:53 +08:00
#!/bin/bash
TOKEN=$(python3 -c "import json; c=json.load(open('$HOME/.openclaw/openclaw.json')); tg=c.get('telegram',c.get('channels',{}).get('telegram',{})); print(tg.get('botToken',''))")
curl -s -X POST "https://api.telegram.org/bot${TOKEN}/setMyCommands" \
-H "Content-Type: application/json" \
-d '{
"commands": [
{"command": "new", "description": "新对话"},
{"command": "stop", "description": "停止生成"},
{"command": "status", "description": "查看状态"},
{"command": "models", "description": "查看可用模型"},
{"command": "reasoning", "description": "切换推理模式"},
{"command": "restart", "description": "重启 Gateway"},
{"command": "help", "description": "帮助"}
]
}'