← 返回
未分类 中文

Sleep Channel

Handle messages in a Discord sleep-tracking channel by grounding all sleep logging and summaries on the real sleep tracker and source Discord metadata. Use w...
Handle messages in a Discord sleep-tracking channel by grounding all sleep logging and summaries on the real sleep tracker and source Discord metadata. Use w...
cdmichaelb cdmichaelb 来源
未分类 clawhub v1.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 372
下载
💾 0
安装
1
版本
#latest

概述

Sleep Channel

Deterministic sleep tracker for Discord channel-based sleep logging.

Configuration

Set the following environment variables before use:

VariableRequiredDescription
---------------------------------
SLEEP_TIMEZONEYesIANA timezone string (e.g. America/Los_Angeles, Europe/Berlin)
WORKSPACENoWorkspace root path. Defaults to $HOME/.openclaw/workspace

Core Rules

  • Treat the configured channel as the dedicated sleep channel.
  • Prefer scripts/tracker.py for all log mutations and rendering.
  • Never write now as a logged time.
  • Never derive event time from the model turn time.
  • Use the source Discord message timestamp unless the user explicitly gives a different time.
  • Convert displayed times to the user's local timezone (SLEEP_TIMEZONE).
  • Never invent entries, dates, or file contents.
  • If showing the sleep log, render from the real tracker/file output.

Commands

Add a new sleep event

For messages like: going to bed, still awake, fell asleep, awake now, resting, nap, back to sleep.

python3 scripts/tracker.py add \
  "$MESSAGE_TEXT" \
  "$CHANNEL_ID" \
  "$MESSAGE_ID" \
  "$AUTHOR_ID" \
  "$TIMESTAMP_UTC"

Correct the latest entry

When the user is clearly correcting the previous sleep event.

python3 scripts/tracker.py correct-latest \
  "$MESSAGE_TEXT" \
  "$CHANNEL_ID" \
  "$MESSAGE_ID" \
  "$AUTHOR_ID" \
  "$TIMESTAMP_UTC"

Delete the latest entry

When the user explicitly wants the latest sleep entry removed.

python3 scripts/tracker.py delete-latest

Render the sleep log

Display the current sleep log/summary.

python3 scripts/tracker.py render

Classification Hints

The tracker handles common phrases: fell asleep, awake now, got up, still awake, laying in bed, going to bed, trying to sleep, going back to sleep. Pass raw text to the tracker instead of re-parsing.

If Uncertain

Ask a short clarifying question only when intent is ambiguous:

  • Correction vs new event?
  • Delete the latest entry?
  • Explicit time override?

Files

FilePurpose
---------------
scripts/tracker.pyCanonical sleep tracker (self-contained, stdlib only)
references/CHANNEL_RULES.mdChannel setup guide (optional)
references/README.mdSystem documentation (optional)

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-05-07 07:28 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Food Channel

cdmichaelb
在食物追踪频道处理消息,通过确定性食物追踪器路由食物摄入事件。适用于在专用食物频道工作时,...
★ 0 📥 415
office-efficiency

Resilient PDF

cdmichaelb
在原生 PDF 处理失败、卡住、超时或拒绝大文件时,恢复 PDF提取和摘要工作流。适用于本地或...
★ 0 📥 456

Medication Channel

cdmichaelb
在药物追踪频道中处理消息,将药物事件通过确定性药物追踪器路由,而不是自由模型判断。
★ 0 📥 417