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