Files
openclaw/scripts/send-sample-tool-notification.ts
Clawd BotandClaude Opus 4.6 ca9b510922 chore: align with upstream openclaw/openclaw and overlay local additions
- Reset master to upstream/main (16,697 commits)
- Overlay 2,271 local-only files (skills, tools, workspace, configs, apps)
- Restore IDENTITY.md and USER.md templates
- Build verified, gateway running, Discord working

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-03 07:40:46 +01:00

32 lines
877 B
TypeScript

import { notifyToolStart, notifyToolEnd } from '../src/notifications/discordToolNotifier';
const webhook = process.env.DISCORD_TOOL_NOTIFIER_WEBHOOK;
async function main() {
if (!webhook) {
console.error('Set DISCORD_TOOL_NOTIFIER_WEBHOOK env var to test');
process.exit(1);
}
await notifyToolStart({
webhookUrl: webhook,
toolName: 'pump-run',
callId: 'test-123',
args: { duration: '5s', mode: 'manual', token: 'supersecret' },
});
await new Promise((r) => setTimeout(r, 1200));
await notifyToolEnd({
webhookUrl: webhook,
toolName: 'pump-run',
callId: 'test-123',
args: { duration: '5s', mode: 'manual' },
resultText: 'Pump run completed successfully. Water dispensed: 200ml',
startTimestamp: Date.now() - 1200,
endTimestamp: Date.now(),
});
}
main().catch((e) => { console.error(e); process.exit(1); });