diff --git a/package.json b/package.json index 7806f6f..9a8e34a 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ }, "scripts": { "dev": "npx nodemon index.ts", - "prod": "npx ts-node index.ts" + "prod": "npx ts-node index.ts", + "build": "npx tsc" } } diff --git a/routes/chatIrcProxy.ts b/routes/chatIrcProxy.ts index facde92..6781e1a 100644 --- a/routes/chatIrcProxy.ts +++ b/routes/chatIrcProxy.ts @@ -1,6 +1,7 @@ import { randomUUID } from 'crypto'; import ws from 'ws'; import { TwitchChat } from '../util/scraping/chat/chat'; +import { logger } from '../util/logger'; interface ExtWebSocket extends ws { id?: string; @@ -86,6 +87,11 @@ export class TwitchChatServer { private handleHostTarget = async(channel: string, viewers: number, target: string, tags: Record) => { const socketsToSend = await this.findClientsForStreamer(channel) + .catch((err) => { + logger.info(`No clients following ${channel}, unsubscribing`) + }) + if(!socketsToSend) return; + for(let socket of socketsToSend) { let payload = { type: 'HOSTTARGET',