Install
openclaw skills install whatsapp-monitorMonitor specified WhatsApp chats for keywords in real time and batch export matched messages to Feishu multi-dimensional tables with optional alerts.
openclaw skills install whatsapp-monitorThis skill enables automated monitoring of WhatsApp conversations, filtering for specific keywords, and batch exporting matching messages to Feishu (Lark) multi-dimensional tables.
使用此技能前,请确保:
配置 WhatsApp 渠道
# 在 OpenClaw 中设置 WhatsApp 渠道
openclaw channels enable whatsapp
配对 WhatsApp 设备
安装技能依赖
cd ~/whatsapp-monitor # 或你的克隆目录,例如 /opt/whatsapp-monitor
pip install -r requirements.txt
配置监控目标
# 编辑配置文件
python scripts/setup.py
配置飞书集成
config/feishu-settings.json测试配置:
python scripts/monitor.py --test-config
启动监控:
python scripts/monitor.py --start
查看状态:
python scripts/monitor.py --status
This skill uses two main configuration files:
config/whatsapp-targets.json - Define WhatsApp contacts/groups to monitorconfig/feishu-settings.json - Configure Feishu API and table settingsCreate config/whatsapp-targets.json:
{
"version": "1.0",
"targets": [
{
"name": "Project Team Chat",
"type": "group", // "contact" or "group"
"identifier": "1234567890-1234567890@g.us", // WhatsApp group ID
"enabled": true,
"keywords": ["urgent", "deadline", "blocker", "issue"],
"priority": "high"
},
{
"name": "Client Support",
"type": "contact",
"identifier": "+1234567890@c.us", // WhatsApp contact ID
"enabled": true,
"keywords": ["complaint", "escalation", "critical", "outage"],
"priority": "medium"
}
],
"monitoring": {
"scan_interval_minutes": 5,
"batch_size": 10,
"max_age_hours": 24,
"alert_on_high_priority": true
}
}
Create config/feishu-settings.json:
{
"feishu": {
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"table_app_token": "YOUR_TABLE_APP_TOKEN",
"table_token": "YOUR_TABLE_TOKEN"
},
"table": {
"name": "WhatsApp Monitor Log",
"fields": [
{"name": "timestamp", "type": "datetime"},
{"name": "source", "type": "text"},
{"name": "sender", "type": "text"},
{"name": "message", "type": "text"},
{"name": "keyword_matched", "type": "text"},
{"name": "priority", "type": "text"}
]
},
"export": {
"batch_threshold": 10,
"schedule": "every 30 minutes",
"retry_on_failure": true,
"max_retries": 3
}
}
初始化配置 - 设置监控目标和飞书凭证
python scripts/setup.py
测试连接 - 验证 WhatsApp 和飞书 API 连接
python scripts/monitor.py --test-config
启动监控 - 开始扫描配置的聊天
python scripts/monitor.py --start
在 OpenClaw 中使用此技能:
# 加载技能(路径改为本机 Linux 上的技能目录)
openclaw skills load ~/whatsapp-monitor
# 或直接调用技能函数
openclaw skills run whatsapp-monitor --start
通过 OpenClaw cron 设置定时监控:
# 创建定时任务
schedule:
kind: "cron"
expr: "*/5 * * * *" # 每5分钟运行一次
payload:
kind: "agentTurn"
message: "运行 WhatsApp 消息监控"
sessionTarget: "isolated"
配置实时告警(当匹配到高优先级关键词时):
config/whatsapp-targets.json 中设置:{
"monitoring": {
"alert_on_high_priority": true
}
}
The system will:
When ready to export, the system will:
See scripts/monitor.py for the main monitoring logic.
See scripts/config.py for handling configuration files.
See scripts/feishu_client.py for Feishu table operations.
See scripts/whatsapp_web.py for WhatsApp Web interaction.
Beyond simple keywords, you can implement:
Configure additional alert channels:
Enhance collected messages with:
Check monitoring logs in logs/whatsapp-monitor.log for operational details and errors.
This skill can be combined with:
Set up automated reports:
For high-volume monitoring:
Regular maintenance tasks:
For detailed API documentation and additional resources, see:
python scripts/monitor.py --start
python scripts/monitor.py --export
python scripts/monitor.py --status
python scripts/monitor.py --test-config
For assistance or feature requests, refer to the troubleshooting section or contact the skill maintainer.