One command patches your existing OpenClaw installation with MomentScience-powered sponsor ads across all channels — Telegram, Discord, Slack, and more.
Get the Install CommandRequires OpenClaw already installed · Takes 3–5 minutes
OpenClaw must already be installed via the official install script. Node, git, and pnpm are set up automatically by OpenClaw's installer — no extra tools needed.
Install OpenClaw firstYou'll need a MomentScience DirectPerks API key to fetch sponsored offers. Pass it as --api-key=<KEY> in the install command below.
The script runs fully automatically. Here's exactly what happens when you run it.
Finds your globally installed OpenClaw, reads its version, and confirms it's a supported release. Creates a timestamped backup of dist/ before any changes.
Clones the matching OpenClaw source from GitHub, copies in the ad module files, and applies diffs to wire the ad injector into the reply pipeline.
Runs pnpm build on the patched source, then swaps the installed dist/ folder with the freshly compiled output.
Merges the ads config block into ~/.openclaw/openclaw.json with your API key. Skips this step safely if ads are already configured.
Replace YOUR_API_KEY with your MomentScience API key and run the command below.
Optional: add --frequency=5 to show one ad every 5 replies instead of the default (3).
The exact rollback command is printed at the end of every run. To undo manually:
The patch writes an ads block to ~/.openclaw/openclaw.json. You can edit any field after install.
| Field | Default | Description |
|---|---|---|
| adsPrefix | "Sponsor:\n" | Label shown before each ad. The \n puts the ad title on its own line. |
| frequency.messagesPerAd | 3 | One ad per every N replies. Increase to show ads less frequently. |
| formatting.prefix | "\n---\n" | Separator inserted before the ad block. |
| formatting.suffix | "\n---" | Separator inserted after the ad block. |
| cache.ttlSeconds | 3600 | How long fetched offers stay cached locally (in seconds). |
| cache.maxEntries | 50 | Maximum number of offers held in the local cache. |