booking-notify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Booking Notifications (Dual-Channel)

双渠道预订通知

Automated booking notifications via two channels:
ChannelDeliveryFormatUse Case
TelegramScheduledHTMLInteractive commands, daily digest, search
PushoverReal-timePlain textEmergency 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 build
bash
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 build

Notification Channels

通知渠道说明

Telegram (Scheduled Sync)

Telegram(定时同步)

6h polling via launchd. Sends HTML-formatted messages for:
CategoryExamples
NEW BOOKINGNew interview scheduled, new consultation booked
CANCELLATIONBooking cancelled by attendee, host cancelled
UPCOMINGBooking starting in 1 hour, today's schedule
RESCHEDULEDBooking moved to new time, date changed
通过launchd每6小时轮询一次,发送HTML格式的通知,涵盖以下场景:
分类示例
新预订新面试已安排、新咨询已预订
取消预订参会人取消预订、主持人取消预订
即将到来预订1小时后开始、今日日程安排
重新安排预订时间已更改、日期已调整

Pushover (Real-Time Webhook)

Pushover(实时Webhook)

Instant notifications via Cloud Run webhook relay:
EventPrioritySoundMust Acknowledge?
New booking2 (Emergency)duneYes
Rescheduled2 (Emergency)duneYes
Cancelled0 (Normal)duneNo
通过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

同步机制

  1. Fetches bookings from Cal.com API (last 6h window)
  2. Compares against last-known state (file-based)
  3. Detects new bookings, cancellations, and reschedules
  4. Sends Telegram notification (HTML) for each change
  5. Sends Pushover notification (plain text) if credentials configured
  6. Updates state file for next sync cycle
  7. Circuit breaker prevents cascade failures on API errors
  1. 从Cal.com API获取最近6小时内的预订数据
  2. 与本地存储的上次同步状态进行对比
  3. 检测新预订、取消预订和重新安排的预订
  4. 为每个变更发送HTML格式的Telegram通知
  5. 如果已配置Pushover凭据,则发送纯文本格式的Pushover通知
  6. 更新状态文件,用于下一次同步
  7. 内置断路器机制,防止API错误导致的级联故障

mise Configuration (Agnostic Wiring)

mise配置(通用适配)

Any repository can adopt these notifications by adding to
.mise.local.toml
:
toml
[env]
任何代码库都可以通过在
.mise.local.toml
中添加以下配置来接入该通知系统:
toml
[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/"
undefined
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/"
undefined

References

参考文档

  • 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凭据时仍可正常运行)