booking-notify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBooking Notifications (Dual-Channel)
双渠道预订通知
Automated booking notifications via two channels:
| Channel | Delivery | Format | Use Case |
|---|---|---|---|
| Telegram | Scheduled | HTML | Interactive commands, daily digest, search |
| Pushover | Real-time | Plain text | Emergency alerts with custom sound (dune) |
通过两个渠道实现自动化预订通知:
| 渠道 | 交付方式 | 格式 | 使用场景 |
|---|---|---|---|
| Telegram | 定时推送 | HTML | 交互式命令、每日摘要、搜索功能 |
| Pushover | 实时推送 | 纯文本 | 带自定义音效(Dune)的紧急警报 |
Mandatory Preflight
必备前置检查
Step 1: Check Sync Script Exists
步骤1:检查同步脚本是否存在
bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/sync.ts" 2>/dev/null || echo "SCRIPT_NOT_FOUND"bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/sync.ts" 2>/dev/null || echo "SCRIPT_NOT_FOUND"Step 2: Verify Environment (Required)
步骤2:验证环境变量(必填)
bash
echo "CALCOM_OP_UUID: ${CALCOM_OP_UUID:-NOT_SET}"
echo "TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:+SET}"
echo "TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:-NOT_SET}"
echo "HAIKU_MODEL: ${HAIKU_MODEL:-NOT_SET}"All must be SET. If any are NOT_SET, run the setup command first.
bash
echo "CALCOM_OP_UUID: ${CALCOM_OP_UUID:-NOT_SET}"
echo "TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:+SET}"
echo "TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:-NOT_SET}"
echo "HAIKU_MODEL: ${HAIKU_MODEL:-NOT_SET}"所有变量必须设置为SET。如果有任何变量显示为NOT_SET,请先运行设置命令。
Step 3: Verify Pushover (Optional)
步骤3:验证Pushover配置(可选)
bash
echo "PUSHOVER_APP_TOKEN: ${PUSHOVER_APP_TOKEN:+SET}"
echo "PUSHOVER_USER_KEY: ${PUSHOVER_USER_KEY:+SET}"
echo "PUSHOVER_SOUND: ${PUSHOVER_SOUND:-dune}"
echo "WEBHOOK_RELAY_URL: ${WEBHOOK_RELAY_URL:-NOT_SET}"If NOT_SET: Pushover is optional. Telegram-only operation still works. To enable, see pushover-setup.md.
bash
echo "PUSHOVER_APP_TOKEN: ${PUSHOVER_APP_TOKEN:+SET}"
echo "PUSHOVER_USER_KEY: ${PUSHOVER_USER_KEY:+SET}"
echo "PUSHOVER_SOUND: ${PUSHOVER_SOUND:-dune}"
echo "WEBHOOK_RELAY_URL: ${WEBHOOK_RELAY_URL:-NOT_SET}"如果显示为NOT_SET:Pushover为可选配置。仅使用Telegram也可正常运行。如需启用,请查看pushover-setup.md。
Step 4: Verify Cal.com CLI Binary
步骤4:验证Cal.com CLI二进制文件
bash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/calcom-cli/calcom" 2>/dev/null || echo "BINARY_NOT_FOUND"If BINARY_NOT_FOUND: Build it:
bash
cd "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/calcom-cli" && bun install && bun run buildbash
ls -la "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/calcom-cli/calcom" 2>/dev/null || echo "BINARY_NOT_FOUND"如果显示BINARY_NOT_FOUND:请执行以下命令构建:
bash
cd "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/calcom-cli" && bun install && bun run buildNotification Channels
通知渠道说明
Telegram (Scheduled Sync)
Telegram(定时同步)
6h polling via launchd. Sends HTML-formatted messages for:
| Category | Examples |
|---|---|
| NEW BOOKING | New interview scheduled, new consultation booked |
| CANCELLATION | Booking cancelled by attendee, host cancelled |
| UPCOMING | Booking starting in 1 hour, today's schedule |
| RESCHEDULED | Booking moved to new time, date changed |
通过launchd每6小时轮询一次,发送HTML格式的通知,涵盖以下场景:
| 分类 | 示例 |
|---|---|
| 新预订 | 新面试已安排、新咨询已预订 |
| 取消预订 | 参会人取消预订、主持人取消预订 |
| 即将到来 | 预订1小时后开始、今日日程安排 |
| 重新安排 | 预订时间已更改、日期已调整 |
Pushover (Real-Time Webhook)
Pushover(实时Webhook)
Instant notifications via Cloud Run webhook relay:
| Event | Priority | Sound | Must Acknowledge? |
|---|---|---|---|
| New booking | 2 (Emergency) | dune | Yes |
| Rescheduled | 2 (Emergency) | dune | Yes |
| Cancelled | 0 (Normal) | dune | No |
通过Cloud Run Webhook中继发送即时通知:
| 事件 | 优先级 | 音效 | 是否需要确认? |
|---|---|---|---|
| 新预订 | 2(紧急) | dune | 是 |
| 重新安排 | 2(紧急) | dune | 是 |
| 取消预订 | 0(正常) | dune | 否 |
Webhook Relay
Webhook中继
The webhook relay is a lightweight Cloud Run service that bridges Cal.com webhooks to Pushover. See webhook-relay.md for deployment.
Webhook中继是一个轻量级Cloud Run服务,用于连接Cal.com Webhook与Pushover。部署说明请查看webhook-relay.md。
Running Manually
手动运行方式
bash
cd ~/own/amonic && bun run "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/sync.ts"bash
cd ~/own/amonic && bun run "$HOME/.claude/plugins/marketplaces/cc-skills/plugins/calcom-commander/scripts/sync.ts"Sync Behavior
同步机制
- Fetches bookings from Cal.com API (last 6h window)
- Compares against last-known state (file-based)
- Detects new bookings, cancellations, and reschedules
- Sends Telegram notification (HTML) for each change
- Sends Pushover notification (plain text) if credentials configured
- Updates state file for next sync cycle
- Circuit breaker prevents cascade failures on API errors
- 从Cal.com API获取最近6小时内的预订数据
- 与本地存储的上次同步状态进行对比
- 检测新预订、取消预订和重新安排的预订
- 为每个变更发送HTML格式的Telegram通知
- 如果已配置Pushover凭据,则发送纯文本格式的Pushover通知
- 更新状态文件,用于下一次同步
- 内置断路器机制,防止API错误导致的级联故障
mise Configuration (Agnostic Wiring)
mise配置(通用适配)
Any repository can adopt these notifications by adding to :
.mise.local.tomltoml
[env]任何代码库都可以通过在中添加以下配置来接入该通知系统:
.mise.local.tomltoml
[env]Required (Telegram)
必填(Telegram相关)
CALCOM_OP_UUID = "<1password-uuid>"
TELEGRAM_BOT_TOKEN = "<bot-token>"
TELEGRAM_CHAT_ID = "<chat-id>"
CALCOM_OP_UUID = "<1password-uuid>"
TELEGRAM_BOT_TOKEN = "<bot-token>"
TELEGRAM_CHAT_ID = "<chat-id>"
Optional (Pushover dual-channel)
可选(Pushover双渠道相关)
PUSHOVER_APP_TOKEN = "<pushover-app-token>"
PUSHOVER_USER_KEY = "<pushover-user-key>"
PUSHOVER_SOUND = "dune"
WEBHOOK_RELAY_URL = "https://calcom-pushover-webhook-XXXXX.us-central1.run.app/"
undefinedPUSHOVER_APP_TOKEN = "<pushover-app-token>"
PUSHOVER_USER_KEY = "<pushover-user-key>"
PUSHOVER_SOUND = "dune"
WEBHOOK_RELAY_URL = "https://calcom-pushover-webhook-XXXXX.us-central1.run.app/"
undefinedReferences
参考文档
- notification-templates.md — Dual-channel message templates
- pushover-setup.md — Pushover credential setup guide
- webhook-relay.md — Webhook relay deployment + management
- sync-config.md — Sync interval and state management
- notification-templates.md — 双渠道消息模板
- pushover-setup.md — Pushover凭据设置指南
- webhook-relay.md — Webhook中继部署与管理
- sync-config.md — 同步间隔与状态管理
Post-Change Checklist
变更后检查清单
- YAML frontmatter valid (no colons in description)
- Trigger keywords current
- Path patterns use $HOME not hardcoded paths
- Pushover graceful degradation verified (works without Pushover creds)
- YAML前置元数据有效(描述中无冒号)
- 触发关键词为最新版本
- 路径模式使用$HOME而非硬编码路径
- 已验证Pushover的优雅降级(无Pushover凭据时仍可正常运行)