返回顶部
m

mrc-monitorMRC令牌监控

Real-time token monitoring for MRC canteen order system. Monitors Firebase Firestore for token status and notifies when orders are ready. Use when user sends commands like "mrc 73", "token 97", or "monitor 42" to monitor one or multiple canteen tokens. Handles multiple tokens simultaneously, sends independent notifications per token, and auto-exits when all tokens are ready.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,845
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

mrc-monitor

技能名称: mrc-monitor
详细描述:

MRC食堂监控

监控MRC食堂订单令牌,并在订单准备好取餐时发送通知。

快速开始

当用户发送包含食堂令牌的命令时:

  1. 1. 从消息中提取所有令牌编号
  2. 启动后台监控脚本
  3. 立即回复确认信息

命令识别

用户可能使用各种前缀发送令牌:

  • - mrc 73 或 mrc 73 97 42
  • token 73 或 token 73 97
  • monitor 73
  • check 73(仅单次查询)

启动监控

从用户消息中提取所有数字并启动后台监控:

bash
python3 skills/mrc-monitor/scripts/monitor.py <平台> <频道ID> <令牌1> <令牌2> ...

其中:

  • - 平台:telegram 或 discord
  • 频道ID:当前频道标识符(平台前缀可选,例如 telegram_123 或 123 均可使用)
  • 令牌1、令牌2、...:需要监控的令牌编号

示例:
bash
python3 skills/mrc-monitor/scripts/monitor.py telegram telegram_6046286675 73 97 42


python3 skills/mrc-monitor/scripts/monitor.py telegram 6046286675 73 97 42

后台执行

将监控作为后台进程启动,以便代理立即响应:

python
import subprocess

频道ID可以带或不带平台前缀(两者均可)

cmd = [python3, skills/mrc-monitor/scripts/monitor.py, platform, channel_id] + [str(t) for t in tokens] subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

代理响应

启动监控后,立即回复:

✅ 正在监控令牌:73, 97, 42
每15秒检查一次。
准备好后我会在这里通知您!🍕

单次查询

对于check 73命令,执行一次Firebase查询并返回状态,不启动后台监控。

监控行为

监控脚本:

  • - 每15秒轮询Firebase Firestore
  • 每次轮询检查所有监控中的令牌
  • 当令牌状态变为Ready时发送🍕 订单X已准备好!通知
  • 将已通知的令牌从监控列表中移除
  • 当所有令牌都通知完毕时自动退出
  • 优雅处理错误并重试
  • 将所有活动记录到skills/mrc-monitor/logs/monitorYYYYMMDDHHMMSS.log

错误处理

脚本自动处理:

  • - 网络超时(最多重试5次)
  • HTTP错误(包括速率限制)
  • 意外错误(连续5次失败后停止)
  • 信号终止(SIGTERM、SIGINT)

发生致命错误时,脚本会在退出前发送通知。

Firebase详情

  • - 项目:kanteen-mrc-blr-24cfa
  • 集合:orders
  • 文档字段
- studentId(字符串):student-{令牌编号} - status(字符串):Preparing、Ready、Completed

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mrc-monitor-1776368789 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mrc-monitor-1776368789 技能

通过命令行安装

skillhub install mrc-monitor-1776368789

下载

⬇ 下载 mrc-monitor v1.0.0(免费)

文件大小: 4.47 KB | 发布时间: 2026-4-17 14:35

v1.0.0 最新 2026-4-17 14:35
Initial release: Real-time canteen order token monitoring with background notifications.

- Monitors multiple canteen tokens via Firestore and notifies when orders are ready.
- Immediate response: Confirms tokens are being monitored and notifies in channel upon readiness.
- Supports multiple commands and simultaneous token monitoring.
- Runs background monitor as a subprocess; auto-exits when all tokens are ready.
- "Check" commands perform a one-time status check without continuous monitoring.
- Robust error handling and detailed activity logging included.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部