Chat statistics: per-viewer messages, emotes, commands; raw chat kept 30 days

Server reads chat via EventSub channel.chat.message (works without OBS) and counts
each message at once into chat_user, chat_user_day, chat_emote (Twitch + 7TV by
name) and chat_command. Raw messages are a 30-day buffer (hourly cleanup); deletes,
timeouts/bans and chat clears remove stored text at once; hidden chatters are not
counted. chatlog.forgetUser() for removal requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-11-22 17:21:34 +02:00
parent 30f42a65e8
commit cd751e3a07
5 changed files with 156 additions and 2 deletions

View file

@ -377,4 +377,5 @@ module.exports = {
getAllVariations, getVariationsFor, getVariation, createVariation, updateVariation, renameTrigger, deleteVariation,
getAllTtsVoices, getTtsVoice, createTtsVoice, updateTtsVoice, deleteTtsVoice,
logActivity, getActivityLog, getActivity,
raw: () => db, // for modules that keep their own tables (chatlog.js)
};