返回顶部
l

last-words遗言传递

Auto-deliver final messages to loved ones after 30 days of inactivity. Use when user wants to record a final message, configure email delivery, manage voice messages, or check configuration status.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
100
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

last-words

Last Words - 最后留言

管理当用户长时间无法联系时,将最终留言传递给亲人的功能。

概述

本技能帮助用户录制一条最终留言(语音或文字),当用户超过30天没有活动时,将这条留言发送给他们的父母或亲人。系统:

  1. 1. 安全地记录并存储最终留言(文字 + 可选的语音/音频)
  2. 通过聊天记录监控用户活动
  3. 在用户不活跃的第10天和第20天发送警告通知
  4. 在用户不活跃30天后自动发送留言(邮件中会附上语音文件,如果有的话)
  5. 支持通过邮件发送(微信和电话功能正在规划中)

工作流程

1. 录制最终留言

当用户说类似我想给我爸妈留下最后一句话时:

  1. 1. 回复:可以,请说吧,顺便提醒一下这句话默认设置半个月没和我聊天记录的话就会自动触发
  2. 接受语音或文字输入作为留言内容
  3. 使用以下命令保存留言:scripts/save_message.py --message 内容 [--audio-path 路径]
  4. 确认:已保存,请确认发送形式:邮件 或 微信

2. 配置发送设置

询问用户选择发送方式:

  • - 邮件:收集邮箱地址
  • 微信:收集微信号(占位符 - 尚未实现)
  • 电话:收集电话号码(占位符 - 尚未实现)

使用以下命令保存设置:scripts/configure_delivery.py --method email --contact address@example.com

3. 交互式邮件配置(聊天)

用户可以通过自然的聊天对话配置邮件设置:

触发短语:

  • - 配置最后留言邮箱
  • 设置最后留言邮箱
  • 最后留言 配置邮箱
  • 最后留言 设置邮箱
  • 修改最后留言邮箱

交互流程:

  1. 1. 询问发件邮箱:
- 回复:请提供你的发件邮箱(用于发送留言的邮箱,目前支持QQ邮箱): - 等待用户输入:例如 your-email@qq.com
  1. 2. 询问授权码:
- 回复:请提供邮箱授权码(不是登录密码)。QQ邮箱授权码获取方式:登录QQ邮箱→设置→账户→开启POP3/SMTP服务→获取授权码: - 等待用户输入:例如 xxxxxxxxxxxxxxxx
  1. 3. 询问收件邮箱:
- 回复:请提供收件人邮箱(父母/亲人的邮箱): - 等待用户输入:例如 parent@example.com
  1. 4. 确认并保存:
- 显示摘要:配置确认:\n发件人:{smtp_user}\n收件人:{contact}\n是否确认保存?(确认/取消) - 如果用户确认: - 运行:python3 scripts/configuredelivery.py --method email --contact {contact} --smtp-host smtp.qq.com --smtp-port 465 --smtp-user {smtpuser} --smtp-pass {smtp_pass} - 回复:✓ 邮箱配置已保存。正在测试邮件发送... - 运行测试:python3 scripts/debugmode.py on 然后 python3 scripts/debugmode.py send - 回复测试结果 - 如果用户取消:已取消配置。

交互式配置的安全说明:

  • - 密码在聊天显示中被屏蔽(例如:授权码已收到:
  • 凭证仅存储在本地
  • 用户可以随时通过说修改最后留言邮箱重新配置

4. 语音/音频支持

用户可以为留言附加语音录音:

选项A:保存现有音频文件
bash
python3 scripts/audio_manager.py save /path/to/recording.wav

选项B:从麦克风录制(如果可用)
bash
python3 scripts/audio_manager.py record

播放已保存的音频:
bash
python3 scripts/audio_manager.py play

列出所有已保存的音频文件:
bash
python3 scripts/audio_manager.py list

音频文件将在最终留言发送时作为邮件附件。

5. 调试模式管理(聊天)

用户可以通过正常的聊天对话,明确提及最后留言来管理调试模式:

开启调试模式:
当用户说:最后留言 开启调试模式、最后留言 打开调试或最后留言 启用调试

  1. 1. 运行:python3 scripts/debug_mode.py on
  2. 回复:最后留言调试模式已开启。现在可以立即发送测试消息,无需等待30天。

关闭调试模式:
当用户说:最后留言 关闭调试模式或最后留言 禁用调试

  1. 1. 运行:python3 scripts/debug_mode.py off
  2. 回复:最后留言调试模式已关闭。系统恢复正常运行(30天无活动后发送)。

检查调试模式状态:
当用户说:最后留言 调试模式状态或最后留言 调试状态

  1. 1. 运行:python3 scripts/debug_mode.py status
  2. 显示当前状态和配置摘要

立即发送测试(调试模式开启时):
当用户说:最后留言 立即发送测试或最后留言 测试发送

  1. 1. 运行:python3 scripts/debug_mode.py send
  2. 报告结果:发送成功/失败的详细信息

6. 每日检查流程

通过cron每天运行 scripts/check_activity.py 以:

  • - 检查最后聊天时间戳
  • 在用户不活跃10天时发送警告
  • 在用户不活跃20天时发送警告
  • 在用户不活跃30天时发送最终留言(如果有音频附件则一并发送)

命令参考

保存留言(仅文字)

bash python3 scripts/save_message.py --message 爸爸妈妈我爱你们

保存留言并附带音频

bash

先保存音频文件

python3 scripts/audio_manager.py save /path/to/voice-recording.wav

或直接录制(需要麦克风)

python3 scripts/audio_manager.py record

配置发送方式

bash python3 scripts/configure_delivery.py --method email --contact parent@example.com

方式:email, wechat, phone

音频管理

bash python3 scripts/audio_manager.py save /path/to/audio.wav # 保存现有音频 python3 scripts/audio_manager.py record # 从麦克风录制 python3 scripts/audio_manager.py play # 播放已保存的音频 python3 scripts/audio_manager.py list # 列出所有音频文件

检查活动(每天运行)

bash python3 scripts/check_activity.py

获取状态

bash python3 scripts/get_status.py

重置/清除数据

bash python3 scripts/reset.py

调试模式(测试)

启用调试模式以跳过30天等待期,测试即时发送:

启用/禁用调试模式:
bash
python3 scripts/debug_mode.py on # 启用调试模式
python3 scripts/debug_mode.py off # 禁用调试模式
python3 scripts/debug_mode.py status # 检查调试模式状态

调试模式下即时发送:
bash
python3 scripts/debug_mode.py send # 立即发送消息(调试)

或使用带调试标志的检查脚本:
bash
python3 scripts/check_activity.py --debug-send # 强制立即发送

调试模式启用时:

  • - 消息可以立即发送,无需等待30天
  • 用于测试邮件发送、音频附件等
  • 系统仍会将发送记录为调试/测试发送
  • 正常使用时请禁用调试模式

数据存储

所有数据存储在SQLite数据库中,路径为 ~/.openclaw/last-words/data.db:

  • - message:存储最终留言内容和音频路径
  • config:存储发送方式和联系信息
  • activity_log:跟踪每日检查结果和发送记录

安全与隐私

  • - 留言仅存储在本地
  • 留言内容不使用云存储或外部API调用
  • 邮件发送使用用户配置的SMTP设置
  • 所有脚本在OpenClaw沙箱中运行

设置每日检查

添加到OpenClaw cron:
bash
openclaw cron add --name last-words-check --schedule 0 9 * --command python3 ~/.openclaw/workspace/last-words/scripts/check_activity.py

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 last-words-1776017963 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 last-words-1776017963 技能

通过命令行安装

skillhub install last-words-1776017963

下载

⬇ 下载 last-words v1.0.0(免费)

文件大小: 24.7 KB | 发布时间: 2026-4-13 10:48

v1.0.0 最新 2026-4-13 10:48
Initial release of "last-words" skill.

- Enables users to record and securely store a final message (text and/or voice) for loved ones, to be delivered after 30 days of inactivity.
- Provides interactive chat-based configuration for email delivery, including setup for sender/recipient and SMTP authorization.
- Supports voice message recording, playback, and management; voice files are sent as attachments.
- Delivers warning notifications at 10 and 20 days of inactivity; auto-sends the final message at 30 days, with daily automated checks.
- Includes a debug mode for immediate message testing, full status checks, and reset/clear functions.
- All data is locally stored for user privacy and security.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部