Install
openclaw skills install discord-ai-dispatcherRoutes Discord notifications with a two-tier system using hardcoded rules and local AI, supports message updates to reduce clutter, and optimizes resource use.
openclaw skills install discord-ai-dispatcherThe 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.
Instead of relying solely on AI categorization, this dispatcher implements a Deterministic Prefix Engine to ensure 100% routing accuracy:
updateId (e.g., systemevent00100) directly dictates the target channel.
systemevent -> Infrastructure Eventsappalert -> Application Monitoringuserupdate -> User ActivityTo handle out-of-order API deliveries or network retries, the dispatcher uses a Sequential State Tracker:
XXXXX in prefixXXXXX).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.To prevent race conditions and file corruption when the AI takes longer than the polling interval:
dispatcher.lock at the start of the orchestrator.try/finally blocks to ensure the lock is released even if the script crashes.State files can be corrupted by power loss or interrupted writes.
ConvertFrom-Json call in a try/catch.Instead of a "Negative Filter" (which deletes bad formatting), this skill uses a Positive Healing logic to repair inconsistent AI output:
**Bold Labels**.** **), escaped characters, and unwanted markdown blocks.Prevent chat clutter by updating existing messages instead of posting new ones.
PATCH (or corresponding update paradigm) instead of POST for webhooks....
The Webhook Notifier is built to be a self-improving system. When a gap is found, the agent must shift from Monitor to Diagnostician:
Instead of guessing, the agent must scan the dispatcher.log for the "Missing IDs":
duplicate) but not Delivered: Indicates the deduplication logic was too aggressive (Historical Logic Flaw).When the user feeds you an RCA report, you should automatically suggest (or implement) one of the following:
last-seen-ids.json or polling-state.json to the actual last-delivered marker to ensure the "Gaps" are re-sent.Test-IsSequentialDuplicate helper to be more specific.Test-IsSequentialDuplicate filter to ensure recovery happens.To maintain aesthetics and readability:
while($true) loops to prevent memory leaks and handle system reboots gracefully.-AsHashtable fails in 5.1. Use manual property-looping to convert PSCustomObjects into Hashtables for reliable $state[$key] access.-Encoding UTF8 on Set-Content to prevent character corruption in mixed-version environments.Designed for extensible and robust notification pipelines.