← 返回
未分类 中文

Medication Channel

Handle messages in a medication-tracking channel by routing medication events through a deterministic medication tracker instead of freehand model judgment....
在药物追踪频道中处理消息,将药物事件通过确定性药物追踪器路由,而不是自由模型判断。
cdmichaelb cdmichaelb 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 366
下载
💾 0
安装
1
版本
#latest

概述

Medication Channel

Use the deterministic medication logging path whenever source message metadata is available.

Configuration

Set the following environment variables or replace placeholders before use:

  • MEDICATION_TIMEZONE — IANA timezone string for local time display (e.g. America/Los_Angeles, Europe/Berlin)
  • WORKSPACE — root directory for data files (defaults to ~/.openclaw/workspace)

Medication names and schedules are configured at the top of scripts/tracker_v2.py — edit the MORNING_MEDS, EVENING_MEDS, and KNOWN_MEDS lists to match your regimen.

Core Rules

  • Treat the configured channel as the dedicated medication channel.
  • Prefer the log_from_discord.sh wrapper or tracker_v2.py log-from-message.
  • Never use now as a logged/displayed 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 configured timezone.
  • Never log reminder chatter as medication history.
  • Never treat an assistant reminder message, assistant follow-up, assistant summary, or assistant self-referential chatter as a medication event.
  • Never emit a confirmation like "taken", "logged", or "recorded" in response to an assistant-generated reminder unless a real user medication report was just logged through the script path.
  • Never claim something was logged unless the script path actually ran.
  • Prefer raw-message passthrough to the tracker instead of model-side parsing.

Preferred Workflow

Log a medication message from Discord

Use when the user reports:

  • taken / took
  • done / completed
  • missed / skipped
  • extra dose
  • clear natural-language medication intake

Preferred path:

scripts/log_from_discord.sh \
  "$MESSAGE_TEXT" \
  "$CHANNEL_ID" \
  "$MESSAGE_ID" \
  "$AUTHOR_ID" \
  "$TIMESTAMP_UTC"

Equivalent direct call:

python3 scripts/tracker_v2.py log-from-message \
  "$MESSAGE_TEXT" \
  "$CHANNEL_ID" \
  "$MESSAGE_ID" \
  "$AUTHOR_ID" \
  "$TIMESTAMP_UTC"

Then use the returned row or format-confirmation output for the confirmation.

Parse only

Use only when inspecting behavior or debugging.

python3 scripts/tracker_v2.py parse "$MESSAGE_TEXT" "$TIMESTAMP_UTC"

Format a confirmation

Use when you already have the JSON row and want the standard confirmation string.

python3 scripts/tracker_v2.py format-confirmation '<json-row>'

Special Guardrail: Reminder Messages

If the message being handled is itself a reminder, or the user is replying to/quoting a reminder message, do not assume medication was taken.

Examples that are not medication events by themselves:

  • an assistant message like Reminder: it's time to take your evening medication.
  • an assistant message like Evening medication taken (recorded at ...)
  • a user message like something went wrong again
  • a user reply that is discussing a reminder failure rather than reporting intake

In these cases:

  • do not call the tracker unless the user message itself contains an actual medication event
  • do not fabricate a confirmation
  • debug/explain briefly instead

What the Tracker Already Handles

The tracker is preferred because it already handles:

  • common natural-language medication phrases
  • normalization of common misspellings / aliases
  • morning/evening inference
  • dedupe by source Discord message id
  • local timezone display formatting
  • structured logging

So do not manually re-implement those steps unless debugging the tracker itself.

If Uncertain

Ask a short clarifying question only when needed, such as:

  • whether the message is a real medication event vs general discussion
  • whether the user is saying they skipped something or are uncertain
  • whether a custom explicit time should override the source timestamp

Data Access

This skill reads and writes persistent files in the workspace:

  • Writes $WORKSPACE/data/medication_log_v2.csv — one row per medication event (med name, status, timestamps, source message ID)
  • Writes deduplication state keyed by source message ID
  • Reads medication config from MORNING_MEDS/EVENING_MEDS/KNOWN_MEDS lists at top of scripts/tracker_v2.py
  • No network calls — fully local, stdlib-only Python
  • No external APIs — no vision, no remote services

Required Files

The following files are included in the bundle:

  • scripts/log_from_discord.sh — Discord wrapper script
  • scripts/tracker_v2.py — medication parser/logger
  • references/CHANNEL_RULES.md — optional channel behavior reference
  • references/README.md — optional setup reference

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 15:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Food Channel

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

ClawdHub Publish Helper

cdmichaelb
准备并发布 OpenClaw 技能到 ClawHub。负责 PII/密钥审计、通用化处理、环境变量提取、目录脚手架搭建、git init,以及其他相关步骤。
★ 0 📥 415

Sleep Channel

cdmichaelb
Handle messages in a Discord sleep-tracking channel by grounding all sleep logging and summaries on the real sleep track
★ 0 📥 418