From db3cc16dd29f3e070a03ffc8557815b351272691 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 22 Sep 2023 06:50:57 -0500 Subject: [PATCH] fix: bets overlay wasn't sending --- packages/twitch/events/src/SubscribeEvents.ts | 20 +++++++++---------- runner.sh | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/twitch/events/src/SubscribeEvents.ts b/packages/twitch/events/src/SubscribeEvents.ts index 167000ab..646e84db 100644 --- a/packages/twitch/events/src/SubscribeEvents.ts +++ b/packages/twitch/events/src/SubscribeEvents.ts @@ -6,13 +6,11 @@ import { onlineEvent } from './twitch/lib/onlineEvent.js' import { updateUserEvent } from './twitch/lib/updateUserEvent.js' import { DOTABOD_EVENTS_ROOM, eventsIOConnected, socketIo } from './utils/socketUtils.js' -export const handleEvent = (eventName: any, data: any) => { +export const handleEvent = (eventName: any, broadcasterId: string, data: any) => { if (!eventsIOConnected) { - console.log('[TWITCHEVENTS] No socket connection') return } - console.log('[TWITCHEVENTS] Emitting event', { eventName, data }) - socketIo.to(DOTABOD_EVENTS_ROOM).emit('event', eventName, data.broadcasterId, data) + socketIo.to(DOTABOD_EVENTS_ROOM).emit('event', eventName, broadcasterId, data) } export const SubscribeEvents = (accountIds: string[]) => { @@ -24,37 +22,37 @@ export const SubscribeEvents = (accountIds: string[]) => { promises.push(listener.onUserUpdate(userId, updateUserEvent)) promises.push( listener.onChannelPredictionBegin(userId, (data) => - handleEvent('onChannelPredictionBegin', transformBetData(data)), + handleEvent('onChannelPredictionBegin', userId, transformBetData(data)), ), ) promises.push( listener.onChannelPredictionProgress(userId, (data) => - handleEvent('onChannelPredictionProgress', transformBetData(data)), + handleEvent('onChannelPredictionProgress', userId, transformBetData(data)), ), ) promises.push( listener.onChannelPredictionLock(userId, (data) => - handleEvent('onChannelPredictionLock', transformBetData(data)), + handleEvent('onChannelPredictionLock', userId, transformBetData(data)), ), ) promises.push( listener.onChannelPredictionEnd(userId, (data) => - handleEvent('onChannelPredictionEnd', transformBetData(data)), + handleEvent('onChannelPredictionEnd', userId, transformBetData(data)), ), ) promises.push( listener.onChannelPollBegin(userId, (data) => - handleEvent('onChannelPollBegin', transformPollData(data)), + handleEvent('onChannelPollBegin', userId, transformPollData(data)), ), ) promises.push( listener.onChannelPollProgress(userId, (data) => - handleEvent('onChannelPollProgress', transformPollData(data)), + handleEvent('onChannelPollProgress', userId, transformPollData(data)), ), ) promises.push( listener.onChannelPollEnd(userId, (data) => - handleEvent('onChannelPollEnd', transformPollData(data)), + handleEvent('onChannelPollEnd', userId, transformPollData(data)), ), ) } catch (e) { diff --git a/runner.sh b/runner.sh index 4cc328bc..aefdf047 100644 --- a/runner.sh +++ b/runner.sh @@ -121,7 +121,7 @@ pull() { push() { docker_login buildall - docker_command push twitch-events dota twitch-chat steam + docker_command push twitch-events } buildall() {