Per-viewer action statistics: rewards, Power-ups, cheers, subs, gifts, follows, raids, tips

chat_action counts every logged viewer event (via dispatch.js) per viewer and item,
with total spent (points / bits / months / subs / viewers / tip money). Keyed by
Twitch user id, or name:<login> for events without one. Hidden chatters skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-11-22 17:24:21 +02:00
parent cd751e3a07
commit 862edf6d5d
3 changed files with 63 additions and 5 deletions

View file

@ -35,6 +35,9 @@ function dispatchEvent(eventType, eventDetail = null, username = null, data = nu
// the log must never take the server down (a bad row once crashed it mid-stream)
try { db.logActivity(eventType || 'unknown', eventDetail, username, data, fired, replay); }
catch (e) { console.error(`[dispatch] activity log failed (${eventType}):`, e.message); }
// per-viewer action statistics (chatlog.js)
try { require('./chatlog').onAction(eventType, eventDetail, username, data, replay); }
catch (e) { console.error(`[dispatch] action stats failed (${eventType}):`, e.message); }
}
module.exports = { dispatchEvent };