Watch time: one 5-minute tick while live (lurkers included), per-stream check-ins

watchtime.js: stream.online/offline (+ Helix /streams check at start) give the live
state; every 5 min the chatter list (Helix /chat/chatters, new scope
moderator:read:chatters) gets +1 tick = 5 minutes = 5 points, overall and per day,
so watch time and points share one sync. First chat message per stream is stored as
a check-in. Without the scope the tick logs once and skips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-11-22 17:35:21 +02:00
parent f4ee205d4a
commit 1c36e80f66
6 changed files with 145 additions and 2 deletions

View file

@ -15,6 +15,7 @@ const SCOPES = [
'channel:read:polls', // channel.poll.* (poll card on the overlay)
'channel:read:hype_train', // channel.hype_train.* (Hype Train alerts)
'channel:manage:raids', // start/cancel raids from the dashboard (send-off card stays during the countdown)
'moderator:read:chatters', // watch time: chatter list every 5 min while live (watchtime.js)
].join(' ');
router.get('/login', (req, res) => {