闲社服务运行正常AI智能体自动化平台
u

未回复消息

技能标识:unanswered-messages

Track and find unanswered messages using a local file-based inbox. No DB required. Use when asked to find unanswered messages, missed messages, people waiting for a response, or to log a new incoming message.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

未回复消息

技能名称: unanswered-messages
详细描述:

未回复消息(基于文件)

追踪发送给Heleni但尚未回复的消息。
无需数据库 — 使用 /opt/ocana/openclaw/workspace/inbox/pending.json。



文件结构

/opt/ocana/openclaw/workspace/inbox/pending.json:

json
{
version: 1,
messages: [
{
id: MSG_ID,
ts: 2026-04-01T14:30:00Z,
chat_id: +972XXXXXXXXX,
chat_name: Netanel,
chat_type: direct,
sender_name: Netanel,
sender_phone: +972XXXXXXXXX,
body: message text...,
answered: false,
answered_at: null
}
]
}



1. 记录一条传入消息

当需要回复的消息到达时,将其添加到文件中:

python
import json, datetime

INBOX = /opt/ocana/openclaw/workspace/inbox/pending.json

with open(INBOX) as f:
data = json.load(f)

data[messages].append({
id: ,
ts: datetime.datetime.utcnow().isoformat() + Z,
chatid: id>,
chatname: name>,
chat_type: direct, # 或 group
sendername: name>,
senderphone: phone>,
body: ,
answered: False,
answered_at: None
})

with open(INBOX, w) as f:
json.dump(data, f, indent=2)



2. 将消息标记为已回复

回复后,将其标记为已完成:

python
import json, datetime

INBOX = /opt/ocana/openclaw/workspace/inbox/pending.json

with open(INBOX) as f:
data = json.load(f)

for msg in data[messages]:
if msg[id] == :
msg[answered] = True
msg[answered_at] = datetime.datetime.utcnow().isoformat() + Z

with open(INBOX, w) as f:
json.dump(data, f, indent=2)



3. 查找未回复消息

python
import json
from datetime import datetime, timedelta, timezone

INBOX = /opt/ocana/openclaw/workspace/inbox/pending.json
MAXAGEHOURS = 24 # 忽略非常旧的消息

with open(INBOX) as f:
data = json.load(f)

cutoff = datetime.now(timezone.utc) - timedelta(hours=MAXAGEHOURS)
unanswered = [
m for m in data[messages]
if not m[answered]
and datetime.fromisoformat(m[ts].replace(Z, +00:00)) > cutoff
]

for m in sorted(unanswered, key=lambda x: x[ts]):
ts = datetime.fromisoformat(m[ts].replace(Z, +00:00)).strftime(%d/%m %H:%M)
print(f📩 {m[sendername]} | {m[chatname]} | {ts})
print(f > {m[body][:100]})
print(f Message ID: {m[id]})



4. 清理 — 移除旧的已回复消息

定期运行(例如通过心跳每周一次)以保持文件小巧:

python
import json
from datetime import datetime, timedelta, timezone

INBOX = /opt/ocana/openclaw/workspace/inbox/pending.json

with open(INBOX) as f:
data = json.load(f)

cutoff = datetime.now(timezone.utc) - timedelta(days=7)
data[messages] = [
m for m in data[messages]
if not m[answered]
or datetime.fromisoformat(m[ts].replace(Z, +00:00)) > cutoff
]

with open(INBOX, w) as f:
json.dump(data, f, indent=2)

print(fKept {len(data[messages])} messages)



心跳集成

在心跳期间,检查过去2小时内未回复的消息:

python
import json
from datetime import datetime, timedelta, timezone

INBOX = /opt/ocana/openclaw/workspace/inbox/pending.json

with open(INBOX) as f:
data = json.load(f)

cutoff = datetime.now(timezone.utc) - timedelta(hours=2)
unanswered = [
m for m in data[messages]
if not m[answered]
and datetime.fromisoformat(m[ts].replace(Z, +00:00)) > cutoff
]

if unanswered:
# 提醒Netanel或直接处理
for m in unanswered:
print(f⚠️ לא ענינו ל-{m[sender_name]}: {m[body][:80]})

将此检查添加到 HEARTBEAT.md 的 Heartbeat Checks 部分下。



输出格式

报告未回复消息的格式为:

  • - 📩 [sendername] | [chatname] | [DD/MM HH:MM]

> [body preview, max 100 chars]
> Message ID: [message_id]

如果来自同一对话的多条消息,则按聊天分组。



备注

  • - ❌ 无需数据库,无需隧道,无需psql — 纯文件I/O
  • ✅ 可离线工作,可在AWS上工作而无需Mac隧道
  • 收件箱文件:/opt/ocana/openclaw/workspace/inbox/pending.json
  • 当前:当Heleni决定追踪消息时,手动记录消息
  • 未来:接入入站消息处理器以自动记录

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 unanswered-messages-1775884741 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 unanswered-messages-1775884741 技能

通过命令行安装

skillhub install unanswered-messages-1775884741

下载

⬇ 下载 unanswered-messages v1.0.0(免费)

文件大小: 2.26 KB | 发布时间: 2026-4-12 11:47

v1.0.0 最新 2026-4-12 11:47
Initial release — track unanswered messages via a local JSON file, no database needed.

- Add, find, and mark messages as answered using a simple file structure.
- Purge old answered messages periodically to keep the file small.
- Provides code snippets for logging, querying, and maintaining an unanswered messages inbox.
- Supports heartbeat integration to alert on recent unanswered messages.
- Designed for offline and AWS use with no external dependencies.