名称: casual-cron
描述: "通过自然语言创建 Clawdbot 定时任务,并遵循严格的运行守卫规则。使用场景:当用户请求安排提醒或消息(重复或单次),特别是通过 Telegram,或当他们使用 /at 或 /every 命令时。示例:'创建一个每天早上 8 点的提醒'、'20 分钟后提醒我'、'下午 3 点给我发一条 Telegram 消息'、'/every 2h'。"
元数据: {"openclaw":{"emoji":"⏰","requires":{"bins":["python3","openclaw"],"env":["CRON_DEFAULT_CHANNEL"]}}}
通过自然语言创建 Clawdbot 定时任务。支持单次和重复计划,并具备安全的运行守卫规则。
/at / /every 命令)中检测出调度意图。openclaw cron add 命令。当消息以 /at 或 /every 开头时,通过 CLI 进行调度(不使用定时任务工具 API)。
使用命令:openclaw cron add
--at "20m")。--session isolated --message "Output exactly: <task>"。--delete-after-run。--deliver --channel <channel> --to <destination>。--every "<duration>"(无需时区)。--cron "<expr>" --tz "America/New_York"。--session isolated --message "Output exactly: <task>"。--deliver --channel <channel> --to <destination>。单次任务(时钟时间,支持夏令时):
openclaw cron add \
--name "提醒示例" \
--at "2026-01-28T15:00:00-05:00" \
--session isolated \
--message "Output exactly: <任务内容>" \
--deliver --channel telegram --to <TELEGRAM_CHAT_ID> \
--delete-after-run
单次任务(相对时间):
openclaw cron add \
--name "20分钟后提醒" \
--at "20m" \
--session isolated \
--message "Output exactly: <任务内容>" \
--deliver --channel telegram --to <TELEGRAM_CHAT_ID> \
--delete-after-run
重复任务(时钟时间,支持夏令时):
openclaw cron add \
--name "每日下午3点提醒" \
--cron "0 15 * * *" --tz "America/New_York" \
--session isolated \
--message "Output exactly: <任务内容>" \
--deliver --channel telegram --to <TELEGRAM_CHAT_ID>
重复任务(时间间隔):
openclaw cron add \
--name "每2小时" \
--every "2h" \
--session isolated \
--message "Output exactly: <任务内容>" \
--deliver --channel telegram --to <TELEGRAM_CHAT_ID>
| 设置项 | 值 |
|---|---|
| 默认时区 | America/New_York(支持夏令时) |
| 默认渠道 | telegram(可通过环境变量 CRON_DEFAULT_CHANNEL 覆盖) |
| 支持的渠道 | telegram, whatsapp, slack, discord, signal |
| 输入 | Cron 表达式 |
|---|---|
8am |
0 8 * * * |
8:45pm |
45 20 * * * |
noon |
0 12 * * * |
midnight |
0 0 * * * |
14:30 |
30 14 * * * |
| 输入 | 行为 |
|---|---|
daily / every day |
每天在指定时间 |
weekdays / mon-fri |
周一至周五在指定时间 |
mondays / every monday |
每周一 |
hourly / every hour |
每小时在整点 |
every 2 hours |
0 */2 * * * |
weekly |
每周(默认为周一) |
monthly |
每月(默认为每月1号) |