From 0390209effcd07aeec5542582e8d3841eea5509a Mon Sep 17 00:00:00 2001 From: Alec Date: Sun, 11 Aug 2024 17:50:49 -0400 Subject: [PATCH] fix bug with bad live feed reference --- modules/gameday.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gameday.js b/modules/gameday.js index b206790..53c1ecd 100644 --- a/modules/gameday.js +++ b/modules/gameday.js @@ -50,9 +50,9 @@ async function statusPoll (bot) { function subscribe (bot, liveGame, games) { LOGGER.trace('Gameday: subscribing...'); const ws = mlbAPIUtil.websocketSubscribe(liveGame.gamePk); - const feed = liveFeed.init(globalCache.values.game.currentLiveFeed); ws.addEventListener('message', async (e) => { try { + const feed = liveFeed.init(globalCache.values.game.currentLiveFeed); const eventJSON = JSON.parse(e.data); /* Once in a while, Gameday will send us duplicate messages. They have different updateIds, but the exact