ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

Discord Ai Dispatcher

Skill by bhupendrafire-ai

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/bhupendrafire-ai/discord-ai-dispatcher
Or

Generic Webhook Notifier: Advanced Skill Guide

The Webhook Notifier skill provides a robust architecture that combines hard heuristics with local AI reasoning tools to ensure 100% routing accuracy and high-density visual formatting.


🚀 The High-Consistency Architecture: Deterministic Routing

Instead of relying solely on AI categorization, this dispatcher implements a Deterministic Prefix Engine to ensure 100% routing accuracy:

  1. Prefix Identification: An updateId (e.g., systemevent00100) directly dictates the target channel.
    • systemevent -> Infrastructure Events
    • appalert -> Application Monitoring
    • userupdate -> User Activity
  2. Zero-Guessing: This removes "Classification Drift" where an AI might misinterpret an update, ensuring data always reaches the correct stakeholders.

🔢 Deterministic Sequential Deduplication

To handle out-of-order API deliveries or network retries, the dispatcher uses a Sequential State Tracker:

  • Logic: It extracts a numeric suffix from the ID (the XXXXX in prefixXXXXX).
  • State: The highest seen ID for each category is stored locally.
  • Rule: Use Numeric Comparison (100 > 99) instead of Alphabetical (100 < 99). Regex-extract digits [^\d] and cast to [long] to ensure the sequence advances even as ID lengths change.
  • Result: You never see a stale update overwrite new data, and duplicate notifications are prevented.

🔒 Global Pipeline Locking (Self-Protection)

To prevent race conditions and file corruption when the AI takes longer than the polling interval:

  1. Lock File: Create a dispatcher.lock at the start of the orchestrator.
  2. Abort Logic: If a lock exists and is "fresh" (< 30 mins), the next pulse must exit immediately.
  3. Atomic Recovery: Always use try/finally blocks to ensure the lock is released even if the script crashes.

🏗️ Self-Healing JSON Recovery

State files can be corrupted by power loss or interrupted writes.

  1. Integrity Checks: Wrap every ConvertFrom-Json call in a try/catch.
  2. Auto-Reset: If parsing fails, log the corruption, delete the broken file, and re-initialize the state from the API source.
  • Benefit: The system self-recovers from disk errors without manual developer intervention.

🩹 The "Healing Cleaner" Pattern

Metadata

Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-bhupendrafire-ai-discord-ai-dispatcher": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.