diff --git a/packages/dota/src/dota/events/gsi-events/newdata.ts b/packages/dota/src/dota/events/gsi-events/newdata.ts index 1e90f0cd..2fac00f0 100644 --- a/packages/dota/src/dota/events/gsi-events/newdata.ts +++ b/packages/dota/src/dota/events/gsi-events/newdata.ts @@ -2,7 +2,7 @@ import { t } from 'i18next' import { DBSettings, getValueOrDefault } from '../../../settings.js' import { steamSocket } from '../../../steam/ws.js' -import { GetLiveMatch } from '../../../stratz/livematch.js' +import { getWinProbability2MinAgo } from '../../../stratz/livematch.js' import { DelayedGames, Packet, SocketClient, validEventTypes } from '../../../types.js' import { logger } from '../../../utils/logger.js' import { events } from '../../globalEventEmitter.js' @@ -146,7 +146,9 @@ eventHandler.registerEvent(`newdata`, { dotaClient.client.gsi?.map?.clock_time && dotaClient.client.gsi?.map?.clock_time % (updateInterval * 60) === 0 ) { - const matchDetails = await GetLiveMatch(parseInt(dotaClient.client.gsi?.map?.matchid, 10)) + const matchDetails = await getWinProbability2MinAgo( + parseInt(dotaClient.client.gsi?.map?.matchid, 10), + ) const lastWinRate = matchDetails?.data.live.match?.liveWinRateValues.slice(-1).pop() if (lastWinRate) { server.io.to(dotaClient.client.token).emit('update-radiant-win-chance', { diff --git a/packages/dota/src/stratz/livematch.ts b/packages/dota/src/stratz/livematch.ts index e2369235..3f490aba 100644 --- a/packages/dota/src/stratz/livematch.ts +++ b/packages/dota/src/stratz/livematch.ts @@ -32,7 +32,7 @@ type StratzLiveMatchResponse = { } } -export const GetLiveMatch = async ( +export const getWinProbability2MinAgo = async ( matchId: number, ): Promise => { if (!process.env.STRATZ_TOKEN) { diff --git a/packages/dota/src/twitch/commands/winprobability.ts b/packages/dota/src/twitch/commands/winprobability.ts index c0d6bf08..e42d6f59 100644 --- a/packages/dota/src/twitch/commands/winprobability.ts +++ b/packages/dota/src/twitch/commands/winprobability.ts @@ -1,7 +1,7 @@ import { t } from 'i18next' import { DBSettings } from '../../settings.js' -import { GetLiveMatch } from '../../stratz/livematch.js' +import { getWinProbability2MinAgo } from '../../stratz/livematch.js' import { logger } from '../../utils/logger.js' import { chatClient } from '../chatClient.js' import commandHandler from '../lib/CommandHandler.js' @@ -36,7 +36,7 @@ commandHandler.registerCommand('winprobability', { if (!apiCooldown[channel] || Date.now() - apiCooldown[channel] >= API_COOLDOWN_SEC * 1000) { try { apiCooldown[channel] = Date.now() - const matchDetails = await GetLiveMatch(parseInt(matchId, 10)) + const matchDetails = await getWinProbability2MinAgo(parseInt(matchId, 10)) const lastWinRate = matchDetails?.data.live.match?.liveWinRateValues.slice(-1).pop() if ( lastWinRate &&