Discord Ai Dispatcher
Skill by bhupendrafire-ai
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bhupendrafire-ai/discord-ai-dispatcherGeneric 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:
- Prefix Identification: An
updateId(e.g.,systemevent00100) directly dictates the target channel.systemevent-> Infrastructure Eventsappalert-> Application Monitoringuserupdate-> User Activity
- 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
XXXXXinprefixXXXXX). - 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:
- Lock File: Create a
dispatcher.lockat the start of the orchestrator. - Abort Logic: If a lock exists and is "fresh" (< 30 mins), the next pulse must exit immediately.
- Atomic Recovery: Always use
try/finallyblocks 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.
- Integrity Checks: Wrap every
ConvertFrom-Jsoncall in atry/catch. - 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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bhupendrafire-ai-discord-ai-dispatcher": {
"enabled": true,
"auto_update": true
}
}
}