feat: moderator bot presence via Discord Gateway

Use Node.js built-in WebSocket to maintain a minimal Discord Gateway
connection for the moderator bot, keeping it 'online' with a
'Watching Moderating' status. Handles heartbeat, reconnect, and resume.

Also fix package-plugin.mjs to include moderator-presence.ts in dist.
This commit is contained in:
zhi
2026-02-28 12:33:58 +00:00
parent fb50b62509
commit a6f2be44b7
3 changed files with 171 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ const outDir = path.join(root, "dist", "whispergate");
fs.rmSync(outDir, { recursive: true, force: true });
fs.mkdirSync(outDir, { recursive: true });
for (const f of ["index.ts", "rules.ts", "turn-manager.ts", "openclaw.plugin.json", "README.md", "package.json"]) {
for (const f of ["index.ts", "rules.ts", "turn-manager.ts", "moderator-presence.ts", "openclaw.plugin.json", "README.md", "package.json"]) {
fs.copyFileSync(path.join(pluginDir, f), path.join(outDir, f));
}