Scans your Twitch chat's current viewer list and flags accounts that look like follow/view-bots, so you can review and block them manually. Nothing is banned automatically.
/ — dashboard: sorted table of flagged accounts with reasons. Once
connected, this is also the landing page./json — same data as JSON.!botcheck — chat command that replies with just the count, e.g. "🤖 4
likely bot viewers out of 212 in chat right now."You no longer set TWITCH_BROADCASTER_LOGIN or TWITCH_MOD_OAUTH_TOKEN by
hand. Instead, visiting /connect and authorizing on Twitch captures your
login, ID, and a refreshable moderator:read:chatters token automatically — same
OAuth pattern GuildScribe already uses (/connect → Twitch → /callback),
stored in this project's own SQLite database. The token also now refreshes
itself instead of expiring every ~4 hours.
Each chatter is scored on:
Known legitimate bots (Nightbot, StreamElements, etc. — see botDetection.ts)
are always excluded. This is heuristic, not certain — glance at a flagged
account before blocking it.
Create a new Val Town project and upload main.ts, twitch.ts, db.ts, and
botDetection.ts. Set main.ts as the HTTP val entrypoint.
Add these four environment variables (account-level Environment Variables page):
| Key | Value |
|---|---|
TWITCH_CLIENT_ID | your app's Client ID — reuse GuildScribe's |
TWITCH_CLIENT_SECRET | your app's Client Secret — reuse GuildScribe's |
TWITCH_BOT_ID | your bot account's numeric user id — reuse GuildScribe's |
EVENTSUB_SECRET | any random string you make up — doesn't need to match GuildScribe's |
Open the val's URL — you'll land on a "Connect my channel" page. Click it, authorize on Twitch, and you're done: broadcaster login, chatters token, and EventSub subscription are all set up automatically in that one step.
In Twitch chat, run /mod guildscribebot (or whichever account owns
TWITCH_BOT_ID) if it isn't already modded, so it's allowed to speak.
Type !botcheck in chat — you should get a reply within a few seconds.
Reloading / from then on shows the dashboard directly, no reconnecting
needed unless Twitch revokes the authorization.
!botcheck and / will say the channel needs to
reconnect — just visit /connect again.!botcheck re-scans the whole chatter list on every call, so there's a couple
seconds of delay before the reply — that's expected, not a bug.