Discord AI Dispatcher — Discord AI Dis补丁er
v1.7.8路由s Discord 通知 with a two-tier 系统 using hardcoded rules and local AI, supports message 更新s to reduce clutter, and 优化s resource use.
运行时依赖
安装命令
点击复制技能文档
Generic 网页hook Notifier: Advanced 技能 图形界面de
The 网页hook Notifier 技能 provides a robust architecture that combines hard heuristics with local AI reasoning 工具s to ensure 100% routing accuracy and high-density visual 格式化ting.
🚀 The High-Consistency Architecture: Deterministic Routing
Instead of relying solely on AI categorization, this dis补丁er implements a Deterministic Prefix Engine to ensure 100% routing accuracy:
Prefix Identification: An 更新Id (e.g., 系统event00100) directly dictates the tar获取 channel. 系统event -> Infrastructure 事件 应用alert -> 应用 监控ing user更新 -> User Activity Zero-Guessing: This 移除s "Classification Drift" where an AI might misinterpret an 更新, ensuring data always reaches the correct stakeholders. 🔢 Deterministic Sequential Deduplication
To handle out-of-order API deliveries or network retries, the dis补丁er uses a Sequential 状态 追踪er:
记录ic: It 提取s a numeric suffix from the ID (the XXXXX in prefixXXXXX). 状态: The highest seen ID for each category is stored locally. Rule: Use Numeric Comparison (100 > 99) instead of Alphabetical (100 < 99). Regex-提取 digits [^\d] and cast to [long] to ensure the sequence advances even as ID lengths change. 结果: You never see a stale 更新 overwrite new data, and duplicate 通知 are 预防ed. 🔒 Global 流水线 Locking (Self-保护ion)
To 预防 race conditions and file corruption when the AI takes longer than the polling interval:
Lock File: 创建 a dis补丁er.lock at the 启动 of the 编排器. Abort 记录ic: If a lock exists and is "fresh" (< 30 mins), the next pulse must exit immediately. Atomic 恢复y: Always use try/finally blocks to ensure the lock is released even if the script crashes. 🏗️ Self-Healing JSON 恢复y
状态 files can be corrupted by power loss or interrupted writes.
Integrity 检查s: Wrap every ConvertFrom-Json call in a try/catch. Auto-Re设置: If parsing fAIls, 记录 the corruption, 删除 the broken file, and re-初始化 the 状态 from the API source. Benefit: The 系统 self-恢复s from disk errors without manual developer intervention. 🩹 The "Healing 清理er" Pattern
Instead of a "Negative 过滤器" (which 删除s bad 格式化ting), this 技能 uses a Positive Healing 记录ic to repAIr inconsistent AI 输出:
Label 提取ion: It 扫描s for colons and automatically wraps the text before them in Bold Labels. Normalization: It forcefully standardizes fluctuating terms to established vocabulary. Noise Black列出: It aggressively strips AI conversational filler. Artifact Stripping: It 清理s up redundant 格式化ting artifacts ( ), escaped characters, and unwanted markdown blocks. 结果: You 获取 a professional, uniform feed even if the AI 模型 获取s "creative". 📊 仪表盘 Mode (清理 Chat Strategy)
预防 chat clutter by updating existing messages instead of posting new ones.
记录ic: Use 补丁 (or cor响应ing 更新 paradigm) instead of POST for 网页hooks. 状态: Store the 创建d message ID in a local 状态 file. Advantage: Provides a single "Living" source of truth for your 系统 状态 without generating unnecessary notification spam. 🪙 令牌 & Cost Optimization
...
Payload P运行ing: Strip all non-essential JSON keys before the AI sees them. 压缩ed Instructions: Use strict 列出-based prompts instead of paragraphs. Low Effort Fallback: If the AI is offline, use a hardcoded template for high avAIlability. 🧠 The AI Improvement Layer: Learning From Gaps
The 网页hook Notifier is built to be a self-improving 系统. When a gap is found, the 代理 must shift from 监控 to Diagnostician:
- The RCA Feed (记录 Diagnostics)
Instead of guessing, the 代理 must 扫描 the dis补丁er.记录 for the "Missing IDs":
Skipped (duplicate) but not Delivered: Indicates the deduplication 记录ic was too aggressive (Historical 记录ic Flaw). Timeout: Indicates the Local LLM needs a higher timeout or more GPU resources. No 记录 Record: Indicates a 失败 at the Poller or API fetch stage.
- Strategic Improvement Loop
When the user feeds you an RCA 报告, you should automatically suggest (or implement) one of the following:
状态 Realignment: Re设置ting last-seen-ids.json or polling-状态.json to the actual last-delivered marker to ensure the "Gaps" are re-sent. 记录ic Tuning: If sequential IDs are conflicting with timestamp IDs, adjust the Test-IsSequentialDuplicate 辅助工具 to be more specific. High-Precision 恢复y: Creating a one-time "Healing 队列" to force-inject missed 通知 into Discord. 🛡️ 恢复y Best Practices: Bypass Deduplication: When in "Heal Mode", always bypass the Test-IsSequentialDuplicate 过滤器 to ensure 恢复y h应用ens. 审计 历史: Perform a "记录 审计" before making changes. Never assume a file is missing just because it's not in the DB—always 检查 the 记录s to confirm if the Dis补丁er ever saw it. 🎨 Best Practices for Professional 格式化ting
To mAIntAIn aesthetics and readability:
Mandatory Bolding: Alway