多机器人去重消息

多飞书机器人去重回复规则。当同一用户通过多个机器人渠道同时发送相同消息时,AI 只回复一次,避免重复打扰。适用于配置了多路飞书机器人接入的 OpenClaw 场景。

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 17 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the actual behavior: the SKILL.md describes a local dedup rule implemented by reading/updating a dedup_state.json file. There are no unrelated env vars, binaries, or install steps requested.
Instruction Scope
Instructions are narrowly scoped to reading/writing skills/multi-bot-dedup/dedup_state.json and computing a simple hash of sender_id + first 50 chars. This is appropriate for deduplication, but the SKILL.md leaves the hashing algorithm unspecified, and it directs persistent storage of sender IDs and timestamps (privacy/retention concern). It also says the AI should '主动遵守' the rule — implementation details (concurrency, atomic updates) are left to the integrator.
Install Mechanism
Instruction-only skill with no install spec and no code files to execute. This minimizes installation risk because nothing is downloaded or installed.
Credentials
No environment variables or external credentials are requested (proportional). However, the skill persists per-user entries (sender_id, last_reply_time, last_message_hash) in a local JSON file — consider whether storing these identifiers is acceptable for your privacy policy and whether the file location has appropriate access controls.
Persistence & Privilege
Does not request always:true or system-wide changes. The only persistence is its own dedup_state.json in its skill path, which is consistent with the described function.
Assessment
This skill is internally consistent and simple, but review these before installing: - Confirm you trust the source (homepage unknown). The skill will store sender IDs, timestamps, and message hashes in skills/multi-bot-dedup/dedup_state.json. - Decide on retention and privacy: remove or rotate entries if you don't want persistent PII. Consider hashing with a salt or storing only non-reversible identifiers if privacy is a concern. - Ensure the runtime has safe file permissions for the skills directory so other users/processes cannot read the state file if that would expose PII. - The SKILL.md leaves hashing and update atomicity unspecified — in multi-process or multi-instance setups you may get race conditions; consider using a central atomic store (Redis/DB) if you need reliable dedup across concurrent workers. - Test in a staging environment to confirm the 30s window and first-50-characters rule meet your needs and don't cause unexpected suppression of legitimate replies.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk9730y40tccxxgv3eqasrj0t59831wph

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

multi-bot-dedup — 多飞书机器人去重回复

使用场景

用户配置了多个飞书机器人(如兵部/吏部/礼部/钦天监/御书房/太医院等),同一条消息会同时触发多个机器人渠道,导致 AI 重复回复。本 skill 提供去重规则,确保每条消息只回复一次。

去重规则

收到消息时,先检查以下条件,全部满足才跳过(NO_REPLY),否则正常回复

  1. 发送者匹配dedup_state.json 中存在该 sender_id 的记录
  2. 时间窗口:上次回复时间距现在 < 30秒
  3. 内容相同:消息内容前50字的 hash 与上次相同

三条全满足 → NO_REPLY(跳过) 否则 → 正常回复,并更新 dedup_state.json

状态文件

位置:skills/multi-bot-dedup/dedup_state.json

{
  "ou_6a0ac66dd49d41eef5e5b85c68dafb9f": {
    "last_reply_time": 1742130000000,
    "last_message_hash": "abc123"
  }
}

操作步骤

Step 1 — 读取 dedup_state.json(不存在则跳过检查,正常回复)

Step 2 — 计算 sender_id + 消息内容前50字 的简单 hash

Step 3 — 对比:

  • now - last_reply_time < 30000mshash == last_message_hashNO_REPLY
  • 否则继续正常处理

Step 4 — 回复后立即更新 dedup_state.json

例外(必须回复,不去重)

  • 消息内容与上次不同(新话题)
  • 距上次回复超过 30 秒
  • 用户明确说"再说一遍"等重复指令

参数说明

参数默认值说明
时间窗口30秒覆盖多路同时触发延迟(通常 < 5秒)
hash 长度消息前50字防止相同内容被误判为不同消息

注意

本 skill 是行为规范,不是可执行代码。AI 在每次处理飞书消息时主动遵守上述规则。

Files

2 total
Select a file
Select a file to preview.

Comments

Loading comments…